RFR: 8209894: ZGC: Cap number of GC workers based on heap size

Per Liden per.liden at oracle.com
Fri Aug 24 12:36:20 UTC 2018


Hi,

Thanks for reviewing Erik. However, I reworked this a little bit. 
Instead of using HeapSizePerGCThread, which has no real correlation with 
the overhead per worker thread, I'm using a cap based on the percent of 
the max heap size that we allow the reserve to occupied. The end result 
is similar, i.e. we use a low number of threads on tiny heaps.

http://cr.openjdk.java.net/~pliden/8209894/webrev.1

/Per

On 08/24/2018 09:35 AM, Erik Helin wrote:
> On 08/23/2018 04:43 PM, Per Liden wrote:
>> The ergonomics for selecting number of GC workers does not take 
>> HeapSizePerGCThread into account. This is sub-optimal and can even 
>> lead to pre-mature OOME when using a tiny heap on a very large 
>> machine, since ZGC reserves 2M of the heap per GC worker.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8209894
>> Webrev: http://cr.openjdk.java.net/~pliden/8209894/webrev.0
> 
> Looks good to me, nice incremental improvement! Perhaps a future patch 
> might want to look into re-evaluating these calculations at a safepoint 
> in case number of CPUs/cores changes (like for virtual machines, 
> containers, etc)?
> 
> Thanks,
> Erik
> 
>> /Per



More information about the hotspot-gc-dev mailing list