JDK-8318636 : Add jcmd to print annotated process memory map
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2023-10-22
  • Updated: 2024-07-29
  • Resolved: 2023-11-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 22
22 b24Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Analysts and supporters often use /proc/xx/maps to make sense of the memory footprint of a process.

Interpreting the memory map correctly can help when used as a complement to other tools (e.g. NMT). There even exist tools out there that attempt to annotate the process memory map with JVM information.

That, however, can be much more easily and accurately done within the JVM. At least for mappings originating from hotspots, we have the relevant information in NMT.


Comments
The dumped process map file is not large , for example : ls -alL pmap.txt -rw-r--r-- 1 xxxx yyyyy 18223 Mar 19 16:52 pmap.txt Why don't we output it in failure case in the test ? Would help to analyze the issue. ( Btw. System.dump_map could be any kind of map, it is not a very helpful/descriptive name. Why not System.dump_pmem_map (still rather short) or something similar? )
19-03-2024

Since March we saw a couple of failures (on linuxx86_64 / linuxaarch64) in our nightlies in the test serviceability/dcmd/vm/SystemDumpMapTest.java. (no issues before) The failure log output looks like : Missing patterns in dump: .*0x\\p{XDigit}+ - 0x\\p{XDigit}+ +\\d+.*META.* .*0x\\p{XDigit}+ - 0x\\p{XDigit}+ +\\d+.*JAVAHEAP.* .*0x\\p{XDigit}+ - 0x\\p{XDigit}+ +\\d+.*STACK.*main.* .*0x\\p{XDigit}+ - 0x\\p{XDigit}+ +\\d+.*CODE.* test SystemDumpMapTest.jmx(): failure java.lang.RuntimeException: java.lang.RuntimeException: Missing patterns might be interesting to check/output a bit more in failure cases (is the vm_memory_map_<pid>.txt maybe empty? Or ends before the expected things ?).
19-03-2024

Changeset: 6f863b2a Author: Thomas Stuefe <stuefe@openjdk.org> Date: 2023-11-13 08:26:42 +0000 URL: https://git.openjdk.org/jdk/commit/6f863b2a1baa67deb2a7b33fcd93d272aea01812
13-11-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16301 Date: 2023-10-22 10:08:49 +0000
22-10-2023