RFR: 8312132: Add tracking of multiple address spaces in NMT [v105]

Johan Sjölen jsjolen at openjdk.org
Mon May 27 10:33:18 UTC 2024


On Fri, 24 May 2024 07:36:48 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/hotspot/share/nmt/nmtNativeCallStackStorage.hpp line 119:
>> 
>>> 117:     }
>>> 118:   }
>>> 119: };
>> 
>> Possibly for follow up RFE: I would like to see number of stacks in the NMT statistic (there is this statistic subcommand to the jcmd VM.native_memory). I also would like to see those statistics in the hs-err file.
>> 
>> For example, if we ever decide to track larger stacks (which would make a lot of sense, 4 frames is really not much), we will see a logarithmic (?) increase in number of stacks. I would like to know those numbers. Note that I sometimes do that during investigations, and I have a RFE open somewhere to make the number of frames in stacks tunable with a VM options.
>
> Note: mid-term we should place *all* stacks in here, not just those for tracking ZGC. And replace all physical copies of stacks with StackIndex.

>we will see a logarithmic (?) increase in number of stacks

I'd expect it to be exponential. Assume each function in the stack trace has a branch `if (a) alloc_A() else alloc_B()`, that causes a doubling of total stack sequences stored. I believe that we have the advantage of common subsequences, in which case we can implement it as a trie. That may ruin the `StackIndex`strategy however. Thoughts for the future.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18289#discussion_r1615855611


More information about the hotspot-dev mailing list