RFR(xs): 8145190: MinTLABSize can cause overflow problem with CMS GC

Jesper Wilhelmsson jesper.wilhelmsson at oracle.com
Fri Jan 29 13:13:52 UTC 2016

Looks good!

Den 29/1/16 kl. 07:46, skrev sangheon:
> Hi all,
>     Could I have reviews for this small change to avoid an overflow for
> MinTLABSize?
>    Current maximum value of MinTLABSize makes SIGFPE on CMSCollector constructor
> as 'PLAB::min_size() * HeapWordSize' makes an overflow. 'size_t
> PLAB::min_size()' which returns 'align_object_size(MAX2(MinTLABSize /
> HeapWordSize, (uintx)oopDesc::header_size())) + AlignmentReserve' makes the
> problem with addition of 'AlignmentReserve'.
>    MinTLABSize flag is 'AfterMemoryInit' which means the constraint check will
> happen after creating the heap, because we need to check this flag to be larger
> than ThreadLocalAllocBuffer::alignment_reserve_in_bytes().
>    As the maximum value of max_uintx is not practical, it would be better to
> restrict its maximum than introducing additional constraint check. For now we
> don't have multiple time constraint check. And any value smaller than 'max_uintx
> - PLAB::AlignmentReserve*HeapWordSize' will be fine but I think 'max_uintx / 2'
> is large enough. PLAB::AlignmentReserve is calculated after heap creation.
>    With quite large values, this problem would be hidden by other flags
> constraint. e.g. YoungPLABSize.
>     I didn't add a new test as JDK-8144578 enables to check this problem.
> CR: https://bugs.openjdk.java.net/browse/JDK-8145190
> Webrev: http://cr.openjdk.java.net/~sangheki/8145190/webrev.00
> Testing: JPRT, RBT (TestOptionsWithRanges.java for all platforms including CMS GC)
> Thanks,
> Sangheon

More information about the hotspot-gc-dev mailing list