RFR: 8328944: NMT reports "unknown" memory

Gerard Ziemski gziemski at openjdk.org
Sat Nov 16 02:42:56 UTC 2024


On Mon, 4 Nov 2024 07:18:02 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> We use mtNone value in several functions default parameters, which may show up in NMT reports.
>> 
>> We address this, by removing the default value and forcing, where possible, for the callers to declare NMT tag that reflects the usage.
>> 
>> Eventually the goal would be not to use mtNone anywhere, but we are not there quite yet.
>> 
>> TODO: update copyrights.
>> 
>> Testing: undergoing MARCH5 tier1-5 ...
>
> src/hotspot/cpu/aarch64/compressedKlass_aarch64.cpp line 72:
> 
>> 70:     assert(immediate > 0 && Assembler::operand_valid_for_logical_immediate(/*is32*/false, immediate),
>> 71:            "Invalid immediate %d " UINT64_FORMAT, index, immediate);
>> 72:     result = os::attempt_reserve_memory_at((char*)immediate, size, false, mtMetaspace);
> 
> mtMetaspace is wrong. There is no right tag apart from mtNone, since this address range is a combination of mtClass+mtClassShared, depending on how class space is configured. mtNone signals "will be set later", which is the correct course here IHMO.
> 
> The tag is set later, see metaspace.cpp and metaspaceShared.cpp

Can we introduce `mtAllocated` and use it here instead of `mtNone` and keep `mtNone` only as the initial "unassigned" state?

> src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp line 82:
> 
>> 80: 
>> 81:   // Reserve address space for backing memory
>> 82:   _base = (uintptr_t)os::reserve_memory(max_capacity, false, mtGC);
> 
> This is Java heap.

Fixed.

> src/hotspot/share/cds/archiveBuilder.cpp line 330:
> 
>> 328:   size_t buffer_size = estimate_archive_size();
>> 329:   ReservedSpace rs(buffer_size, MetaspaceShared::core_region_alignment(),
>> 330:                    os::vm_page_size(), nullptr, mtMetaspace);
> 
> This is not Metaspace. Possibly mtClassShared, though that one is reserved for the runtime mapping of the CDS archive; this is the dumptime image. mtInternal would be the best fit, IMHO.

Fixed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21843#discussion_r1844882191
PR Review Comment: https://git.openjdk.org/jdk/pull/21843#discussion_r1844882271
PR Review Comment: https://git.openjdk.org/jdk/pull/21843#discussion_r1844882386


More information about the shenandoah-dev mailing list