-
Bug
-
Resolution: Fixed
-
P4
-
15, 16
-
None
-
Docker
-
b09
-
generic
-
linux
During review of JDK-8244500 it was discovered that with the new cgroups implementation supporting v1 and v2 Metrics.getMemoryAndSwapLimit() will never return 0 when relevant cgroup files are missing. E.g. on a system where the kernel doesn't support swap limit capabilities. Therefore this code introduced with JDK-8236617 can no longer be reached and should get removed:
if (limit >= 0 && memLimit >= 0) {
- return limit - memLimit;
+ // we see a limit == 0 on some machines where "kernel does not support swap limit capabilities"
+ return (limit < memLimit) ? 0 : limit - memLimit;
}
More details here:
http://mail.openjdk.java.net/pipermail/hotspot-dev/2020-June/042167.html
if (limit >= 0 && memLimit >= 0) {
- return limit - memLimit;
+ // we see a limit == 0 on some machines where "kernel does not support swap limit capabilities"
+ return (limit < memLimit) ? 0 : limit - memLimit;
}
More details here:
http://mail.openjdk.java.net/pipermail/hotspot-dev/2020-June/042167.html
- relates to
-
JDK-8236617 jtreg test containers/docker/TestMemoryAwareness.java fails after 8226575
- Resolved
-
JDK-8244500 jtreg test error in test/hotspot/jtreg/containers/docker/TestMemoryAwareness.java
- Resolved