RFR: 8313593: Generational ZGC: NMT assert when the heap fails to expand

Stefan Karlsson stefank at openjdk.org
Wed Aug 2 07:22:10 UTC 2023


On Wed, 2 Aug 2023 07:15:31 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

> The following assert is hit when the ZGC fails to commit more memory for the heap:
> 
> assert(size > 0) failed: Invalid size
> ...
> V  [libjvm.so+0x185d157]  VirtualMemoryTracker::add_committed_region(unsigned char*, unsigned long, NativeCallStack const&)+0x4d7  (virtualMemoryTracker.cpp:428)
> V  [libjvm.so+0x19c1f33]  ZNMT::process_fake_mapping(zoffset, unsigned long, bool)+0xa3  (memTracker.hpp:168)
> V  [libjvm.so+0x19db817]  ZPhysicalMemoryManager::commit(ZPhysicalMemory&)+0x47  (zPhysicalMemory.cpp:312)
> V  [libjvm.so+0x19d1e4b]  ZPageAllocator::alloc_page_finalize(ZPageAllocation*)+0x6b  (zPageAllocator.cpp:427)
> 
> The problem is that we still call the NMT reporting code even when the committed size is zero.

I've tested this patch by injecting commit and uncommit failures and made sure that this patch prevents the asserts.

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

PR Comment: https://git.openjdk.org/jdk/pull/15120#issuecomment-1661641254


More information about the hotspot-gc-dev mailing list