changeset 60392:8f7ede592c28

8247863: Unreachable code in OperatingSystemImpl.getTotalSwapSpaceSize() Summary: After 8231111 we have -1 for missing metrics, thus the fix of 8236617 is obsolete Reviewed-by: mbaesken
author sgehwolf
date Fri, 19 Jun 2020 10:40:04 +0200
parents c35fba4bce35
children 324a37eb090d
files src/jdk.management/unix/classes/com/sun/management/internal/OperatingSystemImpl.java
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.management/unix/classes/com/sun/management/internal/OperatingSystemImpl.java	Thu Jul 30 02:47:00 2020 -0400
+++ b/src/jdk.management/unix/classes/com/sun/management/internal/OperatingSystemImpl.java	Fri Jun 19 10:40:04 2020 +0200
@@ -61,8 +61,7 @@
             // it can use as much memory as the host's OS allows.
             long memLimit = containerMetrics.getMemoryLimit();
             if (limit >= 0 && memLimit >= 0) {
-                // we see a limit == 0 on some machines where "kernel does not support swap limit capabilities"
-                return (limit < memLimit) ? 0 : limit - memLimit;
+                return limit - memLimit; // might potentially be 0 for limit == memLimit
             }
         }
         return getTotalSwapSpaceSize0();