From:
http://mail.openjdk.java.net/pipermail/zgc-dev/2018-January/000127.html
I was looking at the NMT output from one of our stress tests and saw something unexpected. It looks like the first number commits of small ZPages get merged into one region, until we allocate a medium ZPage which ends up at the end of the virtual address space. After the medium ZPage has been allocated non of the subsequent small ZPages get merged.
I traced the committing of memory:
[0.079s][info][gc ] nmt_commit 0x0000040000000000 514048K
[2.523s][info][gc ] nmt_commit 0x000004001f600000 2048K
[2.528s][info][gc ] nmt_commit 0x000004001f800000 2048K
[2.533s][info][gc ] nmt_commit 0x000004001fa00000 2048K
[2.535s][info][gc ] nmt_commit 0x000004001fc00000 2048K
[2.537s][info][gc ] nmt_commit 0x000004001fe00000 2048K
[2.538s][info][gc ] nmt_commit 0x0000040020000000 2048K
[2.543s][info][gc ] nmt_commit 0x0000040020200000 2048K
[2.547s][info][gc ] nmt_commit 0x0000040020400000 2048K
...
[3.714s][info][gc ] nmt_commit 0x000004003c200000 2048K
[3.715s][info][gc ] nmt_commit 0x000004003c400000 2048K
[3.731s][info][gc ] nmt_commit 0x000007fffe000000 32768K
[3.737s][info][gc ] nmt_commit 0x000007fffc000000 32768K
[3.737s][info][gc ] nmt_commit 0x000004003c600000 2048K
[3.741s][info][gc ] nmt_commit 0x000004003c800000 2048K
The output from NMT is:
[0x0000040000000000 - 0x000004001f600000] committed 514048KB from
[0x00002b9e6209618b] ZPreMappedMemory::ZPreMappedMemory(ZVirtualMemoryManager&, ZPhysicalMemoryManager&, unsigned long)+0xfb
[0x00002b9e6208e277] ZPageAllocator::ZPageAllocator(unsigned long, unsigned long, unsigned long)+0x67
[0x00002b9e620706fc] ZHeap::ZHeap()+0xac
[0x00002b9e6206c2c9] ZCollectedHeap::ZCollectedHeap(ZCollectorPolicy*)+0x49
[0x000004001f600000 - 0x000004003c600000] committed 475136KB from
[0x00002b9e620907bb] ZPageAllocator::alloc_page(unsigned char, unsigned long, ZAllocationFlags)+0x9b
[0x00002b9e620712e7] ZHeap::alloc_page(unsigned char, unsigned long, ZAllocationFlags)+0x17
[0x00002b9e6207faa4] ZObjectAllocator::alloc_object_in_shared_page(ZPage**, unsigned char, unsigned long, unsigned long, ZAllocationFlags)+0x114
[0x00002b9e62081853] ZObjectAllocator::alloc_object(unsigned long)+0x103
[0x000004003c600000 - 0x000004003c800000] committed 2048KB from
[0x00002b9e620907bb] ZPageAllocator::alloc_page(unsigned char, unsigned long, ZAllocationFlags)+0x9b
[0x00002b9e620712e7] ZHeap::alloc_page(unsigned char, unsigned long, ZAllocationFlags)+0x17
[0x00002b9e6207faa4] ZObjectAllocator::alloc_object_in_shared_page(ZPage**, unsigned char, unsigned long, unsigned long, ZAllocationFlags)+0x114
[0x00002b9e62081853] ZObjectAllocator::alloc_object(unsigned long)+0x103
[0x000004003c800000 - 0x000004003ca00000] committed 2048KB from
[0x00002b9e620907bb] ZPageAllocator::alloc_page(unsigned char, unsigned long, ZAllocationFlags)+0x9b
[0x00002b9e620712e7] ZHeap::alloc_page(unsigned char, unsigned long, ZAllocationFlags)+0x17
[0x00002b9e6207faa4] ZObjectAllocator::alloc_object_in_shared_page(ZPage**, unsigned char, unsigned long, unsigned long, ZAllocationFlags)+0x114
[0x00002b9e62081853] ZObjectAllocator::alloc_object(unsigned long)+0x103
As can be seen all pages between:
[2.523s][info][gc ] nmt_commit 0x000004001f600000 2048K
and:
[3.715s][info][gc ] nmt_commit 0x000004003c400000 2048K
are merged into:
[0x000004001f600000 - 0x000004003c600000] committed 475136KB from
However the small page commits after the medium page commits all get separate entries.
http://mail.openjdk.java.net/pipermail/zgc-dev/2018-January/000127.html
I was looking at the NMT output from one of our stress tests and saw something unexpected. It looks like the first number commits of small ZPages get merged into one region, until we allocate a medium ZPage which ends up at the end of the virtual address space. After the medium ZPage has been allocated non of the subsequent small ZPages get merged.
I traced the committing of memory:
[0.079s][info][gc ] nmt_commit 0x0000040000000000 514048K
[2.523s][info][gc ] nmt_commit 0x000004001f600000 2048K
[2.528s][info][gc ] nmt_commit 0x000004001f800000 2048K
[2.533s][info][gc ] nmt_commit 0x000004001fa00000 2048K
[2.535s][info][gc ] nmt_commit 0x000004001fc00000 2048K
[2.537s][info][gc ] nmt_commit 0x000004001fe00000 2048K
[2.538s][info][gc ] nmt_commit 0x0000040020000000 2048K
[2.543s][info][gc ] nmt_commit 0x0000040020200000 2048K
[2.547s][info][gc ] nmt_commit 0x0000040020400000 2048K
...
[3.714s][info][gc ] nmt_commit 0x000004003c200000 2048K
[3.715s][info][gc ] nmt_commit 0x000004003c400000 2048K
[3.731s][info][gc ] nmt_commit 0x000007fffe000000 32768K
[3.737s][info][gc ] nmt_commit 0x000007fffc000000 32768K
[3.737s][info][gc ] nmt_commit 0x000004003c600000 2048K
[3.741s][info][gc ] nmt_commit 0x000004003c800000 2048K
The output from NMT is:
[0x0000040000000000 - 0x000004001f600000] committed 514048KB from
[0x00002b9e6209618b] ZPreMappedMemory::ZPreMappedMemory(ZVirtualMemoryManager&, ZPhysicalMemoryManager&, unsigned long)+0xfb
[0x00002b9e6208e277] ZPageAllocator::ZPageAllocator(unsigned long, unsigned long, unsigned long)+0x67
[0x00002b9e620706fc] ZHeap::ZHeap()+0xac
[0x00002b9e6206c2c9] ZCollectedHeap::ZCollectedHeap(ZCollectorPolicy*)+0x49
[0x000004001f600000 - 0x000004003c600000] committed 475136KB from
[0x00002b9e620907bb] ZPageAllocator::alloc_page(unsigned char, unsigned long, ZAllocationFlags)+0x9b
[0x00002b9e620712e7] ZHeap::alloc_page(unsigned char, unsigned long, ZAllocationFlags)+0x17
[0x00002b9e6207faa4] ZObjectAllocator::alloc_object_in_shared_page(ZPage**, unsigned char, unsigned long, unsigned long, ZAllocationFlags)+0x114
[0x00002b9e62081853] ZObjectAllocator::alloc_object(unsigned long)+0x103
[0x000004003c600000 - 0x000004003c800000] committed 2048KB from
[0x00002b9e620907bb] ZPageAllocator::alloc_page(unsigned char, unsigned long, ZAllocationFlags)+0x9b
[0x00002b9e620712e7] ZHeap::alloc_page(unsigned char, unsigned long, ZAllocationFlags)+0x17
[0x00002b9e6207faa4] ZObjectAllocator::alloc_object_in_shared_page(ZPage**, unsigned char, unsigned long, unsigned long, ZAllocationFlags)+0x114
[0x00002b9e62081853] ZObjectAllocator::alloc_object(unsigned long)+0x103
[0x000004003c800000 - 0x000004003ca00000] committed 2048KB from
[0x00002b9e620907bb] ZPageAllocator::alloc_page(unsigned char, unsigned long, ZAllocationFlags)+0x9b
[0x00002b9e620712e7] ZHeap::alloc_page(unsigned char, unsigned long, ZAllocationFlags)+0x17
[0x00002b9e6207faa4] ZObjectAllocator::alloc_object_in_shared_page(ZPage**, unsigned char, unsigned long, unsigned long, ZAllocationFlags)+0x114
[0x00002b9e62081853] ZObjectAllocator::alloc_object(unsigned long)+0x103
As can be seen all pages between:
[2.523s][info][gc ] nmt_commit 0x000004001f600000 2048K
and:
[3.715s][info][gc ] nmt_commit 0x000004003c400000 2048K
are merged into:
[0x000004001f600000 - 0x000004003c600000] committed 475136KB from
However the small page commits after the medium page commits all get separate entries.
- is cloned by
-
JDK-8196405 [REDO] NMT: add_committed_regions doesn't merge succeeding regions
- Resolved
- relates to
-
JDK-8196372 [BACKOUT] NMT: add_committed_regions doesn't merge succeeding regions
- Closed