-
Enhancement
-
Resolution: Fixed
-
P4
-
18
-
b08
-
linux
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8273601 | 17.0.2 | Thomas Stuefe | P4 | Resolved | Fixed | b01 |
JDK-8325504 | 11.0.22.0.2-oracle | Ivan Bereziuk | P4 | Closed | Fixed | b01 |
JDK-8293486 | 11.0.18 | Thomas Stuefe | P4 | Resolved | Fixed | b01 |
This depends on the granularity of the allocations and a number of other factors, but we found that many small allocations in particular may cause the process heap segment (hence RSS) to get bloaty. This can cause the VM to not recover from C-heap usage spikes.
The glibc offers an API, "malloc_trim", which can be used to cause the glibc to return free'd memory back to the Operating System.
This may cost performance, however, and therefore I hesitate to call malloc_trim automatically. That may be an idea for another day.
Instead of an automatic trim I propose to add a jcmd which allows to manually trigger a libc heap trim. Such a command would have two purposes:
- when analyzing cases of high memory footprint, it allows to distinguish "real" footprint, e.g. leaks, from a cases where the glibc just holds on to memory
- as a stop gap measure it allows to release pressure from a high footprint scenario.
- Note that this command also helps with analyzing libc peaks which had nothing to do with the VM - e.g. peaks created by customer code which just happens to share the same process as the VM. Such memory does not even have to show up in NMT.
In a way, this would be similar to the GC.run jcmd.
I propose to introduce this command for Linux only. Other OSes (apart maybe AIX) do not seem to have this problem, but Linux is arguably important enough in itself to justify a Linux specific jcmd.
- backported by
-
JDK-8273601 jcmd to trim the glibc heap
- Resolved
-
JDK-8293486 jcmd to trim the glibc heap
- Resolved
-
JDK-8325504 jcmd to trim the glibc heap
- Closed
- blocks
-
JDK-8312625 Test serviceability/dcmd/vm/TrimLibcHeapTest.java failed: RSS use increased
- Resolved
- csr for
-
JDK-8269345 Add Linux-specific jcmd to trim the C-heap.
- Closed
- relates to
-
JDK-8261167 print_process_memory_info add a close call after fopen
- Resolved
-
JDK-8293114 JVM should trim the native heap
- Resolved
-
JDK-8276265 jcmd man page is outdated
- Resolved
- links to
-
Commit openjdk/jdk11u-dev/c249ca92
-
Commit openjdk/jdk17u/d9350016
-
Commit openjdk/jdk/6096dd97
-
Review openjdk/jdk11u-dev/1354
-
Review openjdk/jdk17u/70
-
Review openjdk/jdk/4510