Skip to content

Commit 79f02a6

Browse files
committedJun 19, 2020
8247863: Unreachable code in OperatingSystemImpl.getTotalSwapSpaceSize()
After 8231111 we have -1 for missing metrics, thus the fix of 8236617 is obsolete Reviewed-by: mbaesken
1 parent a4eaf95 commit 79f02a6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎src/jdk.management/unix/classes/com/sun/management/internal/OperatingSystemImpl.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ public long getTotalSwapSpaceSize() {
6161
// it can use as much memory as the host's OS allows.
6262
long memLimit = containerMetrics.getMemoryLimit();
6363
if (limit >= 0 && memLimit >= 0) {
64-
// we see a limit == 0 on some machines where "kernel does not support swap limit capabilities"
65-
return (limit < memLimit) ? 0 : limit - memLimit;
64+
return limit - memLimit; // might potentially be 0 for limit == memLimit
6665
}
6766
}
6867
return getTotalSwapSpaceSize0();

0 commit comments

Comments
 (0)
Please sign in to comment.