RFR: 8366363: MemBaseline accesses VMT without using lock [v10]

Johan Sjölen jsjolen at openjdk.org
Tue Sep 2 13:58:10 UTC 2025


On Tue, 2 Sep 2025 13:51:47 GMT, Afshin Zafari <azafari at openjdk.org> wrote:

>> Johan Sjölen has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   After a lot of casting
>
> src/hotspot/share/nmt/memBaseline.cpp line 175:
> 
>> 173:   VirtualMemoryAllocationSite* site;
>> 174:   bool failed_oom = false;
>> 175:   _vma_allocs_replacement->visit_reserved_regions([&](ReservedMemoryRegion& rgn) {
> 
> The `_vma_allocs_replacement` is used only locally here. Instead of creating a copy of the VMATree, we can do our loop here within a lock. Can't we?
> Then we save one tree traverse.

It's used here:

```c++
void MemDetailReporter::report_virtual_memory_map() {
  // Virtual memory map always in base address order
  output()->print_cr("Virtual memory map:");
  _baseline.virtual_memory_allocations()->visit_reserved_regions([&](ReservedMemoryRegion& rgn) {
    report_virtual_memory_region(&rgn);
    return true;
  });
}

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27003#discussion_r2316171652


More information about the hotspot-dev mailing list