RFR: JDK-8318636: Add jcmd to print annotated process memory map [v4]

Thomas Stuefe stuefe at openjdk.org
Sat Oct 28 06:31:29 UTC 2023


On Fri, 27 Oct 2023 17:29:23 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:

> I really like this feature, hope the other platforms can be done as well. (I am also really looking forward to seeing how you did the "malloc" version)
> 
> I think we should set the user expectations correctly and say somewhere that these mappings are only for mmaped memory, ex change:
> 
> `Memory mappings:`
> 
> to
> 
> `Memory mappings (mmaped):`
> 
> or something like that.
> 

That would be more confusing since you can see C-heap mappings as well (mappings the libc allocates via mmap to back its arenas). We don't have VM annotations for them (yet), but they do show up in that list.

> These lines look akward next to each other:
> 
> ```
> 0x000000070a400000 - 0x0000000800000000  4123000832  ---p 00000000    JAVAHEAP                      
> 0x00007f4e747dd000 - 0x00007f4e747e1000       16384  ---p 00000000    STACK(72821 "AWT-EventQueue-0") 
> 0x0000563e6decb000 - 0x0000563e6decc000        4096  r--p 00000000                                  /home/gerard/Desktop/Work/8318636/jdk/build/linux-x86_64-server-fastdebug/images/jdk/bin/java
> 0x00007f4e26000000 - 0x00007f4e26d3b000    13873152  rw-p 00001000    CDS                           /home/gerard/Desktop/Work/8318636/jdk/build/linux-x86_64-server-fastdebug/images/jdk/lib/server/classes.jsa
> ```
> 
> in my opinion. The majority of entries either have the component or path in the **info** field (except CDS). Could we print it simply as:
> 
> ```
> 0x000000070a400000 - 0x0000000800000000  4123000832  ---p 00000000    JAVAHEAP                      
> 0x00007f4e747dd000 - 0x00007f4e747e1000       16384  ---p 00000000    STACK(72821 "AWT-EventQueue-0") 
> 0x0000563e6decb000 - 0x0000563e6decc000        4096  r--p 00000000    /home/gerard/Desktop/Work/8318636/jdk/build/linux-x86_64-server-fastdebug/images/jdk/bin/java
> 0x00007f4e26000000 - 0x00007f4e26d3b000    13873152  rw-p 00001000    CDS=/home/gerard/Desktop/Work/8318636/jdk/build/linux-x86_64-server-fastdebug/images/jdk/lib/server/classes.jsa
> ```

Hmm. Yes, that looks better. I was originally worried about VMAs for files being folded with other ones, then you would have confusing entries like "STACK.. filename bla". But that can actually never happen since VMAs with different files (or one has ha file, one don't) are not folded. Yes, I change that.

> 
> I find the compact way more aesthetically pleasing and easier to read.
> 
> Next I'm going to start looking into the implementation...

Thansk!

-------------

PR Comment: https://git.openjdk.org/jdk/pull/16301#issuecomment-1783721056


More information about the hotspot-runtime-dev mailing list