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

Johan Sjölen jsjolen at openjdk.org
Thu Apr 25 10:10:34 UTC 2024


On Tue, 23 Apr 2024 12:48:12 GMT, Afshin Zafari <azafari at openjdk.org> wrote:

>> Johan Sjölen has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Remove faulty condition after removing merging
>>  - Add failing test case
>
> src/hotspot/share/nmt/nmtMemoryFileTracker.cpp line 47:
> 
>> 45:                                             const NativeCallStack& stack) {
>> 46:   NativeCallStackStorage::StackIndex sidx = _stack_storage.push(stack);
>> 47:   DeviceSpace::Metadata metadata(sidx, flag);
> 
> Can `Metadata` ctor gets a `NaticeCallStack` instead of an index? StackIndex is not used for the rest of the code.

The goal of using `StackIndex` instead of `NativeCallStack`  is to be able to not have duplicate NCS:s throughout the data structure. That's why we store it in the hashtable instead.

> src/hotspot/share/nmt/nmtMemoryFileTracker.cpp line 85:
> 
>> 83:                        NMTUtil::scale_name(scale),
>> 84:                        NMTUtil::flag_to_name(pval.out.metadata().flag));
>> 85:       pval.out.metadata().stack_idx.stack().print_on(stream, 4);
> 
> Why hard coded `4`? Is it the depth of stack?

It's the indentation it should be printed with.

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

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


More information about the hotspot-dev mailing list