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

Afshin Zafari azafari at openjdk.org
Mon Dec 9 10:25:49 UTC 2024


On Fri, 6 Dec 2024 15:47:31 GMT, Robert Toyonaga <duke at openjdk.org> wrote:

>> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   a missed change in a shenandoah file.
>
> src/hotspot/share/nmt/regionsTree.hpp line 135:
> 
>> 133:       }
>> 134:       prev = curr;
>> 135:       if (curr.is_released_begin() || begin_node.out_tag() != curr.out_tag()) {
> 
> It looks like you are running `func(ReservedMemoryRegion)` on partial reserved memory regions, so long as `begin_node.out_tag() != curr.out_tag()`. For example you may run `func(ReservedMemoryRegion)` on a slice of a reserved region, or a single committed region. Isn't the intention to instead find where each whole reserved region starts and ends, then run  `func(ReservedMemoryRegion)` on the entire reserved region?

inline bool is_released_begin() { return out_state() == VMATree::StateType::Released; }

Released means neither reserved nor committed.
In case two different regions are adjacent with different `MemTag`, the `out_tag()` comparison will catch it.

> src/hotspot/share/nmt/regionsTree.hpp line 137:
> 
>> 135:       if (curr.is_released_begin() || begin_node.out_tag() != curr.out_tag()) {
>> 136:         auto st = stack(curr);
>> 137:         size_t r_size = curr.distance_from(begin_node);
> 
> Why is `r_size` never used?

Good catch. It was used in debug checks. No use any more. Removed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1875729264
PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1875725956


More information about the hotspot-runtime-dev mailing list