RFR: 8224820: ZGC: Support discontiguous heap reservations

Per Liden per.liden at oracle.com
Thu Sep 5 13:51:32 UTC 2019


On 8/9/19 11:59 AM, Erik Österlund wrote:
> Hi,
> 
> Today ZGC reserves a huge chunk of virtual address space when the JVM 
> starts. This typically succeeds because we grab the VA before anyone 
> else has time to do so. But if some ASLR library or something was to 
> grab a tiny part of the desired VA, ZGC can't start. We should support 
> discontiguous heap reservations to support this.
> 
> On linux, by default, this does not happen. But on OS X, it does happen 
> relatively frequently. So we need to fix this to allow a mac port.
> 
> This patch implements a recursive algorithm for finding holes at 2MB 
> granularities in the normally contiguous reservation when initializing 
> the heap, removing them from our VA.
> 
> This patch depends on 8224815, which depends on 8229189 and 8229278. 
> They are all out for review.
> 
> Webrev:
> http://cr.openjdk.java.net/~eosterlund/8224820/webrev.00/

Looks good. However, please pass down max_capacity from ZPageAllocator 
to ZVirtualMemory's constructor, instead of reading MaxHeapSize.

cheers,
Per

> 
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8224820
> 
> Thanks,
> /Erik



More information about the hotspot-gc-dev mailing list