RFR: JDK-8318636: Add jcmd to print annotated process memory map [v6]
Brice Dutheil
bdutheil at openjdk.org
Thu Nov 2 15:28:06 UTC 2023
On Wed, 1 Nov 2023 06:26:57 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> src/hotspot/os/linux/memMapPrinter_linux.cpp line 59:
>>
>>> 57: void print_OS_specific_details(outputStream* st) const override {
>>> 58: st->print("%s %s ", _info.prot, _info.offset);
>>> 59: }
>>
>> If that's all this is doing, do we really need it?
>
> This prints protection and offset. The former is interesting for obvious reasons (e.g. lets you tell apart stack guard regions from stack, or uncommitted from committed regions) and the latter interesting for some corner cases (e.g. ZGC mapped regions).
>
> I don't want to do this in shared code though since I am not sure every OS has this information or whether I can obtain this information. I rather not print out a bunch of 0s or empty strings.
>
> The alternative would be carrying a non-descriptive text string around with "OS information", but I don't want to have to think about storage and copying stuff around. It would not be simpler than this.
>
> BTW, the way to implement this on MacOS would be probably by spawning off `vmmap` and parsing the output; on Windows one would use `VirtualQuery`. But I leave this for other folks, I am happy with Linux for now.
On ZGC, by the way, it's possible to see many `memfd:java_heap (deleted)`, does this work allow annotate these mappings ?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16301#discussion_r1380330786
More information about the serviceability-dev
mailing list