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

Gerard Ziemski gziemski at openjdk.org
Wed Mar 5 15:32:03 UTC 2025


On Tue, 25 Feb 2025 09:49:41 GMT, Afshin Zafari <azafari 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*

Changes requested by gziemski (Reviewer).

Changes requested by gziemski (Reviewer).

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?

src/hotspot/share/cds/metaspaceShared.cpp line 1548:

> 1546:       return nullptr;
> 1547:     }
> 1548:     // NMT: fix up the space tags

What exactly needs to be fixed here?

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

PR Review: https://git.openjdk.org/jdk/pull/23770#pullrequestreview-2661498707
PR Review: https://git.openjdk.org/jdk/pull/23770#pullrequestreview-2661515550
PR Review Comment: https://git.openjdk.org/jdk/pull/23770#discussion_r1981647511
PR Review Comment: https://git.openjdk.org/jdk/pull/23770#discussion_r1981635746


More information about the shenandoah-dev mailing list