[jdk21u-dev] RFR: 8293850: need a largest_committed metric for each category of NMT's output
María Arias de Reyna
duke at openjdk.org
Fri Apr 5 09:34:13 UTC 2024
On Fri, 5 Apr 2024 08:58:38 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> This is a backport for https://bugs.openjdk.org/browse/JDK-8293850 (need a largest_committed metric for each category of NMT's output) needed in preparation to backport https://bugs.openjdk.org/browse/JDK-8320061 ( [nmt] Multiple issues with peak accounting )
>>
>> This backport adds peak usage of the memory to the NMT output to be able to detect spikes.
>>
>> Example of usage before the fix:
>>
>>
>> $ jcmd 160812 VM.native_memory detail | grep "mmap: reserved="
>> (mmap: reserved=8388608KB, committed=1277952KB)
>> (mmap: reserved=528392KB, committed=55348KB)
>> (mmap: reserved=197140KB, committed=58260KB)
>> (mmap: reserved=40KB, committed=36KB)
>> (mmap: reserved=8KB, committed=8KB)
>> (mmap: reserved=262144KB, committed=244864KB)
>> (mmap: reserved=1048576KB, committed=34816KB)
>>
>>
>> After the fix (I just started the app, I wasn't really expecting any peak at this point):
>>
>>
>> $ jcmd 161688 VM.native_memory detail | grep "mmap: reserved="
>> (mmap: reserved=8388608KB, committed=507904KB, largest_committed=0KB)
>> (mmap: reserved=1048576KB, committed=31232KB, largest_committed=0KB)
>> (mmap: reserved=528392KB, committed=32836KB, largest_committed=0KB)
>> (mmap: reserved=197140KB, committed=43220KB, largest_committed=0KB)
>> (mmap: reserved=40KB, committed=36KB, largest_committed=0KB)
>> (mmap: reserved=8KB, committed=8KB, largest_committed=0KB)
>> (mmap: reserved=262144KB, committed=216640KB, largest_committed=0KB)
>
> src/hotspot/share/services/memReporter.cpp line 59:
>
>> 57: if (peak != 0) {
>> 58: output()->print(", largest_committed=" SIZE_FORMAT "%s", amount_in_current_scale(peak), scale);
>> 59: }
>
> This seems odd. Not a problem of the backport, but of the original change. For any value lower than `scale` we'll get `0` as a result if I'm reading this right.
>
> Your example output showed:
>
> (mmap: reserved=8388608KB, committed=507904KB, largest_committed=0KB)
>
>
> Yet, it shouldn't be there (due to `peak != 0`). We should get this fixed before we backport.
Ok, I'll investigate
-------------
PR Review Comment: https://git.openjdk.org/jdk21u-dev/pull/440#discussion_r1553261238
More information about the jdk-updates-dev
mailing list