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

Johan Sjölen jsjolen at openjdk.org
Tue Feb 4 14:01:31 UTC 2025


On Thu, 30 Jan 2025 12:55:35 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:
> 
>   fix in shendoahCardTable

src/hotspot/share/nmt/virtualMemoryTracker.cpp line 2:

> 1: /*
> 2:  * Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.

Weird, another copyright issue here

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

> 1: /*
> 2:  * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
> 3:  * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.

Incorrect copyright addition.

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

> 25: 
> 26: #ifndef NMT_VIRTUALMEMORYTRACKER_HPP
> 27: #define NMT_VIRTUALMEMORYTRACKER_HPP

This shouldn't be changed???

src/hotspot/share/nmt/vmatree.cpp line 81:

> 79:       stA.out.set_tag(tag);
> 80:       LEQ_A.state.out.set_tag(tag);
> 81:       stB.in.set_tag(tag);

Commented out assert and an addition I'm trying to wrap my head around. Does this fix a pre-existing bug? If so, this should be a separate PR for mainline before this PR is integrated.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1941220423
PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1941219903
PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1941219525
PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1941214505


More information about the hotspot-dev mailing list