-
Bug
-
Resolution: Unresolved
-
P3
-
23.0.2
In release build, "os::free_swap_space()" seems return a wrong value, but it seems doesn't affect any tests.
Failed tests:
runtime/CommandLine/PrintClasses.java#id1
jdk/jfr/startupargs/TestDumpOnExit.java
jdk/jfr/jcmd/TestJcmdStartStopDefault.java
Root cause:
In case of "Hierarchical Memory and Swap Limit is: Unlimited" in a container, OSContainer::memory_and_swap_limit_in_bytes(), and then os::total_swap_space(), returns a negative value which causes the assertion failure.
I added "-Xlog:os+container=trace" when running runtime/CommandLine/PrintClasses.java:
```
[1.297s][trace][os,container] Path to /memory.memsw.limit_in_bytes is /sys/fs/cgroup/memory/memory.memsw.limit_in_bytes
[1.297s][trace][os,container] Memory Usage is: 2220986368
[1.297s][trace][os,container] Memory and Swap Limit is: 9223372036854771712
[1.297s][trace][os,container] Non-Hierarchical Memory and Swap Limit is: Unlimited
[1.297s][trace][os,container] Path to /memory.stat is /sys/fs/cgroup/memory/memory.stat
[1.297s][trace][os,container] Path to /memory.usage_in_bytes is /sys/fs/cgroup/memory/memory.usage_in_bytes
[1.297s][trace][os,container] Memory Usage is: 2220978176
[1.297s][trace][os,container] Hierarchical Memory and Swap Limit is: 9223372036854771712
[1.297s][trace][os,container] Hierarchical Memory and Swap Limit is: Unlimited
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/builds/jdk/src/hotspot/os/linux/os_linux.cpp:326), pid=987, tid=988
# assert(host_free_swap_val >= 0) failed: sysinfo failed?
```
- caused by
-
JDK-8333522 JFR SwapSpace event might read wrong free swap space size
-
- Resolved
-