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

Afshin Zafari azafari at openjdk.org
Fri Feb 28 13:07:10 UTC 2025


On Thu, 27 Feb 2025 17:54:25 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:

>> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   removed UseFlagInPlace test.
>
> src/hotspot/share/nmt/memoryFileTracker.hpp line 32:
> 
>> 30: #include "nmt/nmtNativeCallStackStorage.hpp"
>> 31: #include "nmt/vmatree.hpp"
>> 32: #include "nmt/virtualMemoryTracker.hpp"
> 
> Are you 100% sure we need it here?

`VirtualMemorySnapshot` is used here which is defined in `virtualMemoryTracker.hpp`.

> src/hotspot/share/nmt/virtualMemoryTracker.cpp line 59:
> 
>> 57:     if (_tracker == nullptr) return false;
>> 58:     new (_tracker) VirtualMemoryTracker(level == NMT_detail);
>> 59:     return _tracker->tree() != nullptr;
> 
> We should check for `tree() != nullptr;` inside VirtualMemoryTracker constructor as assert?

Then in Product build, the `tree == nullptr` ends up in a crash.

> src/hotspot/share/nmt/virtualMemoryTracker.cpp line 135:
> 
>> 133:           VirtualMemorySummary::record_uncommitted_memory(-commit_delta, tag);
>> 134:         else
>> 135:           print_err("uncommit");
> 
> Missing braces.

Done.

> src/hotspot/share/nmt/virtualMemoryTracker.cpp line 213:
> 
>> 211:     log_info(nmt)("region in walker vmem, base: " INTPTR_FORMAT " size: %zu , %s, committed: %zu",
>> 212:      p2i(rgn.base()), rgn.size(), rgn.tag_name(), rgn.committed_size());
>> 213:     if (!walker->do_allocation_site(&rgn))
> 
> Missing braces.

Done.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1975376033
PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1975377752
PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1975380490
PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1975381241


More information about the hotspot-dev mailing list