[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-hotspot-dev
Subject: Re: RFR: JDK-8322475: Extend printing for System.map
From: Thomas Stuefe <stuefe () openjdk ! org>
Date: 2023-12-22 14:47:47
Message-ID: BlEHjbeU0OeLq6iPpLGTD-pLDsnR1tkXVBAJaCVaabE=.a1a66db7-664c-4665-bced-531b6d268282 () github ! com
[Download RAW message or body]
On Fri, 22 Dec 2023 13:08:40 GMT, Stefan Karlsson <stefank@openjdk.org> wrote:
> > This is an expansion on the new `System.map` command introduced with JDK-8318636.
> >
> > We now print valuable information per memory region, such as:
> >
> > - the actual resident set size
> > - the actual number of huge pages
> > - the actual used page size
> > - the THP state of the region (was advised, is eligible, uses THP, ...)
> > - whether the region is shared
> > - whether the region had been committed (backed by swap)
> > - whether the region has been swapped out.
> >
> > Example output:
> >
> >
> > from to size rss hugetlb pgsz \
> > prot notes vm info/file \
> > 0x00000000c0000000 - 0x00000000ffe00000 1071644672 0 4194304 2M \
> > rw-p huge JAVAHEAP /anon_hugepage \
> > 0x00000000ffe00000 - 0x0000000100000000 2097152 0 0 2M \
> > rw-p huge JAVAHEAP /anon_hugepage \
> > 0x0000558016b67000 - 0x0000558016b68000 4096 4096 0 4K \
> > r--p \
> > /shared/projects/openjdk/jdk-jdk/output-fastdebug/images/jdk/bin/java \
> > 0x0000558016b68000 - 0x0000558016b69000 4096 4096 0 4K \
> > r-xp \
> > /shared/projects/openjdk/jdk-jdk/output-fastdebug/images/jdk/bin/java \
> > 0x00007f3a749f2000 - 0x00007f3a74c62000 2555904 2555904 0 4K \
> > rwxp CODE(CodeHeap 'profiled nmethods') \
> > 0x00007f3a74c62000 - 0x00007f3a7be51000 119468032 0 0 4K \
> > ---p nores CODE(CodeHeap 'profiled nmethods') \
> > 0x00007f3a7be51000 - 0x00007f3a7c1c1000 3604480 3604480 0 4K \
> > rwxp CODE(CodeHeap 'profiled nmethods') \
> > 0x00007f3a7c1c1000 - 0x00007f3a7c592000 4001792 0 0 4K \
> > ---p nores CODE(CodeHeap 'non-nmethods') \
> > 0x00007f3a7c592000 - 0x00007f3a7c802000 2555904 2555904 0 4K \
> > rwxp CODE(CodeHeap 'non-profiled nmethods') ...
>
> src/hotspot/os/linux/memMapPrinter_linux.cpp line 276:
>
> > 274: }
> > 275:
> > 276: FILE* f = os::fopen("/proc/self/smaps", "r");
>
> We have seen that reading the smaps file can be extremely bad for the latency of \
> the process. We've seen multi-seconds hangs because of external tools reading \
> smaps. If we add a tool like this it would be good to add a big warning somewhere.
That is a good point, and I was afraid of that myself.
I think I will revise this coding and give the command a "detail" mode, and read \
smaps (with a warning in the "cost" jcmd category) only in details mode. In normal \
mode, "maps" is sufficient. And in summary mode I can get probably away with reading \
stat.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17158#discussion_r1435128384
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic