RFR: 8312132: Add tracking of multiple address spaces in NMT [v105]
Thomas Stuefe
stuefe at openjdk.org
Fri May 24 08:23:17 UTC 2024
On Fri, 24 May 2024 08:12:41 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> src/hotspot/share/nmt/memoryFileTracker.cpp line 51:
>>
>>> 49: VirtualMemory* summary = device->_summary.by_type(NMTUtil::index_to_flag(i));
>>> 50: summary->reserve_memory(diff.flag[i].reserve);
>>> 51: }
>>
>> This seems to be a recurring pattern.
>>
>> - Please make VMATree::SummaryDiff a first-class NMT class. Maybe rename it, too, since it does not necessarily have anything to do with Summary reports. Maybe something like like "MemoryDeltas", being an array of "MemoryDelta". Up to you.
>> - Then give us something like "VirtualMemorySnapshot.apply_delta(MemoryDeltas)".
>>
>> That saves code, and when reading its callsite, your intent is much clearer.
>
> Wait, I made a small thinking error here. If you do this, MemoryDeltas should carry delta for both reserved and committed counters, and therefore is tied to the VirtualMemory case, and should probably be named VirtualMemoryDelta (or Diff or whatever)
You know what, I leave this up to you. We can streamline this in later RFEs.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18289#discussion_r1613071212
More information about the hotspot-dev
mailing list