RFR: JDK-8297958: NMT: Display peak values [v4]

Thomas Stuefe stuefe at openjdk.org
Tue Dec 6 15:07:59 UTC 2022


On Tue, 6 Dec 2022 13:15:30 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> src/hotspot/share/services/memReporter.cpp line 64:
>> 
>>> 62:   }
>>> 63: 
>>> 64:   // blends out mtChunk count number
>> 
>> Before we explicitly passed in 0 as the count for `mtChunk`, but this is not true anymore since we pass in the `MemoryCounter`. So if we want to omit `mtChunk` count we need to reset the count here or handle it some other way.
>
> What it the reason for omitting the `mtChunk` count?

Oh good catch.

I think this has to do with this ugly hack in MallocMemorySnapshot::make_adjustment():

So, we account chunks with mtChunk. Easy. But we also account for arenas. Arenas consists of chunks. To not report memory twice (once under malloced-with-mtChunk, once as "arena") we decrease the malloc size of mtChunk by the combined arena size of all arenas. What's left should be malloc size of free chunks in the free pool.

But that adjustment messes up the mtChunk malloc counter, since it is implemented as one gigantic free. So the counter is garbage.

I'll think of something.

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

PR: https://git.openjdk.org/jdk/pull/11497


More information about the hotspot-runtime-dev mailing list