RFR: JDK-8318636: Add jcmd to print annotated process memory map [v12]
David Holmes
dholmes at openjdk.org
Mon Nov 13 02:49:05 UTC 2023
On Fri, 10 Nov 2023 07:38:24 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> 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 more accurately done from within the JVM, at least for mappings originating from hotspot. After all, we can correlate the mapping information in NMT with the VMA map.
>>
>> Example output (from a spring petstore run):
>>
>> [example_system_map.txt](https://github.com/openjdk/jdk/files/13179054/example_system_map.txt)
>>
>> This patch adds the VM annotations for VMAs that are *mmaped*. I also have an experimental patch that works with malloc'ed memory, but it is not ready yet for consumption and I leave that part of for now.
>
> Thomas Stuefe has updated the pull request incrementally with three additional commits since the last revision:
>
> - add test to test dumping to specific location
> - change filename arg from -f to -F to prevent conflicts with jcmd -f
> - print errno if dump file cannot be opened
Thanks for the updates @tstuefe - nothing further from me (with the Windows variant in the pipeline I will wait and see how things look in terms of shared versus platform-specific code.
Please create a JBS issue to get this new command documented in the jcmd manpage, with details on what that documentation should look like.
Thanks
-------------
PR Review: https://git.openjdk.org/jdk/pull/16301#pullrequestreview-1726475921
More information about the hotspot-runtime-dev
mailing list