JDK-8196405 : [REDO] NMT: add_committed_regions doesn't merge succeeding regions
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 10
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-01-30
  • Updated: 2023-11-09
  • Resolved: 2018-02-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11 b03Fixed
Related Reports
Cloners :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
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. 

Comments
URL: http://hg.openjdk.java.net/jdk/jdk/rev/3acc342c0738 User: jwilhelm Date: 2018-02-28 18:06:35 +0000
28-02-2018

URL: http://hg.openjdk.java.net/jdk/hs/rev/3acc342c0738 User: stefank Date: 2018-02-21 12:19:32 +0000
21-02-2018