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: 2025-03-10
  • 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 21 JDK 22
21.0.8Fixed 22 b24Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8350475 :  
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
[jdk21u-fix-request] Approval Request from Andreas Steiner We want to have this very helpful supportability feature in jdk21u-dev too. Risk is low because new code is only executed if the new jcmd is used. Patch is mostly clean apart from code movement and some test changes. Follow up changes planed: https://bugs.openjdk.org/browse/JDK-8326586, https://bugs.openjdk.org/browse/JDK-8322475 + https://bugs.openjdk.org/browse/JDK-8335710
27-02-2025

Agreed. But I think we should defer this one to the July 2025 release (it's already late in the April cycle).
24-02-2025

[~sgehwolf] This would be useful to have in 21. Risk is low, Patch is mostly clean apart from code movement and some test changes.
21-02-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk21u-dev/pull/1415 Date: 2025-02-19 13:25:34 +0000
19-02-2025

[~stuefe] Thomas - can a release note be created for this enhancement ?
04-02-2025

[~stuefe] Could a release note be created for this new functionality ? Thanks. https://openjdk.org/guide/#release-notes
09-01-2025

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