RFR: 8338929: Make Metaspace::deallocate space-aware

Thomas Stuefe stuefe at openjdk.org
Mon Aug 26 13:03:03 UTC 2024


On Mon, 26 Aug 2024 12:54:27 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/hotspot/share/memory/metaspace.hpp line 123:
>> 
>>> 121:     return is_in_shared_metaspace(ptr) || // in cds
>>> 122:            is_in_class_space(ptr) ||      // in class space
>>> 123:            is_in_nonclass_metaspace(ptr); // in one of the non-class regions?
>> 
>> So the shared_metaspace region, which is the memory for CDS is *not* in class_space?  I suppose for deallocate this doesn't matter since this memory is never deallocated.
>
> By terminology, it is not in class space. 
> 
> Class space I (we? don't we all?) call the section that is governed by the metaspace allocator. The CDS region containing Klass is not in class space. It is, however, in the *narrow Klass decoding range*:
> 
> - Klass decoding range: [CompressedKlassPointers::base() ... CompressedKlassPointers::base() + CompressedKlassPointers::range() )
> - that range contains the CDS klass range, followed (after a possible gap) by the traditional class space. If CDS is off, its just the class space.

There had been a nice ASCII art somewhere, but I cannot find it anymore; maybe someone removed it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20701#discussion_r1731209519


More information about the hotspot-runtime-dev mailing list