RFR: 8366241: NMT: Consolidate [Virtual/Committed/Reserved]Regions into one structure [v4]

Afshin Zafari azafari at openjdk.org
Tue Sep 30 09:41:15 UTC 2025


On Mon, 29 Sep 2025 16:29:32 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> Afshin Zafari has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits:
>> 
>>  - Merge remote-tracking branch 'origin/master' into _8366241_nmt_consolidate_structures
>>  - Merge remote-tracking branch 'origin/master' into _8366241_nmt_consolidate_structures
>>  - master merge fix
>>  - Merge remote-tracking branch 'origin/master' into _8366241_nmt_consolidate_structures
>>  - after merge with 8366363.
>>  - Merge remote-tracking branch 'origin/master' into _8366241_nmt_consolidate_structures
>>  - 8366241: NMT: Consolidate [Virtual/Committed/Reserved]Regions into one structure
>
> src/hotspot/share/nmt/virtualMemoryTracker.hpp line 196:
> 
>> 194:  */
>> 195: class VirtualMemoryRegion {
>> 196:  private:
> 
> Style, pre-existing: Remove this private as it's private by default at the start.

Done

> src/hotspot/share/nmt/virtualMemoryTracker.hpp line 200:
> 
>> 198:   size_t          _size;
>> 199:   MemTag          _mem_tag;
>> 200:   NativeCallStack _reserved_stack, _committed_stack;
> 
> Style: Please separate out these into two declarations on two lines.

Done.

> src/hotspot/share/nmt/virtualMemoryTracker.hpp line 236:
> 
>> 234: 
>> 235:   inline bool contain_address(address addr) const {
>> 236:     assert(is_valid(), "snaity");
> 
> "sanity"

Done.

> src/hotspot/share/nmt/virtualMemoryTracker.hpp line 244:
> 
>> 242:     assert(sz > 0, "Invalid size");
>> 243:     assert(size() > 0, "Invalid size");
>> 244:     assert(is_valid(), "snaity");
> 
> "sanity"

Done.

> src/hotspot/share/nmt/virtualMemoryTracker.hpp line 273:
> 
>> 271:   bool is_valid() const { return base() != nullptr && size() != 0;}
>> 272: 
>> 273:   inline void  set_reserved_call_stack(const NativeCallStack& stack) { _reserved_stack = stack; }
> 
> Is this used? Doesn't it make more sense for these values to be constant and the VMR to be an immutable object (in essence).

No it is not used anymore. Removed.
We cannot make VMR immutable, since we need to return a VMR from `tree->find_reseved_region()`. We need it to be COPYABLE.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27137#discussion_r2390574174
PR Review Comment: https://git.openjdk.org/jdk/pull/27137#discussion_r2390579985
PR Review Comment: https://git.openjdk.org/jdk/pull/27137#discussion_r2390573738
PR Review Comment: https://git.openjdk.org/jdk/pull/27137#discussion_r2390573312
PR Review Comment: https://git.openjdk.org/jdk/pull/27137#discussion_r2390572942


More information about the hotspot-runtime-dev mailing list