RFR: 8350566: NMT: add size parameter to MemTracker::record_virtual_memory_tag

Johan Sjölen jsjolen at openjdk.org
Thu Mar 6 10:27:06 UTC 2025


On Wed, 5 Mar 2025 15:28:59 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:

>> With the `size` parameter there will be no need to traverse/go through the nodes between the base and end of the region.
>> Tests:
>> linux-x64-debug, gtest:NMT* and runtime/NMT*
>
> src/hotspot/share/cds/metaspaceShared.cpp line 1475:
> 
>> 1473:              (address)archive_space_rs.base() == base_address, "Sanity");
>> 1474:       // Register archive space with NMT.
>> 1475:       MemTracker::record_virtual_memory_tag(archive_space_rs.base(), archive_space_rs.size(), mtClassShared);
> 
> The pattern here is:
> 
> `something.base(), something.base.size()`
> 
> instead of doing this over and over again, why can't we just pass `something` to MemTracker::record_virtual_memory_tag() and let it figure out `base` and `size` itself?

We could have an overload for `ReservedSpace`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23770#discussion_r1983093725


More information about the shenandoah-dev mailing list