RFR: 8337217: Port VirtualMemoryTracker to use VMATree [v30]

Gerard Ziemski gziemski at openjdk.org
Mon Feb 24 21:20:12 UTC 2025


On Mon, 24 Feb 2025 12:45:51 GMT, Afshin Zafari <azafari at openjdk.org> wrote:

>> - `VMATree` is used instead of `SortedLinkList` in new class `VirtualMemoryTrackerWithTree`.
>>  -  A wrapper/helper `RegionTree` is made around VMATree to make some calls easier.
>>  -  Both old and new versions exist in the code and can be selected via `MemTracker::set_version()`
>>  - `find_reserved_region()` is used in 4 cases, it will be removed in further PRs.
>>  - All tier1 tests pass except one ~that expects a 50% increase in committed memory but it does not happen~  https://bugs.openjdk.org/browse/JDK-8335167.
>>  - Adding a runtime flag for selecting the old or new version can be added later.
>>  - Some performance tests are added for new version, VMATree and Treap, to show the idea and should be improved later. Based on the results of comparing speed of VMATree and VMT, VMATree shows ~40x faster response time.
>
> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
> 
>   test file got back, fixed coding style

My feedback so far, more tomorrow.

Is the description out of date?

It says 

> Both old and new versions exist in the code and can be selected via MemTracker::set_version()

but that's not true right?

src/hotspot/share/nmt/virtualMemoryTracker.hpp line 381:

> 379:   bool remove_uncommitted_region (address base_addr, size_t size);
> 380:   bool remove_released_region    (address base_addr, size_t size);
> 381:   bool remove_released_region    (ReservedMemoryRegion* rgn);

Why are they returning `bool` ? I don't see the return value being used anywhere?

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

PR Review: https://git.openjdk.org/jdk/pull/20425#pullrequestreview-2637959728
PR Comment: https://git.openjdk.org/jdk/pull/20425#issuecomment-2679666750
PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1968340892


More information about the hotspot-dev mailing list