8195158: Concurrent System.gc() is "upgraded" to stop-the-world System.gc()

Erik Helin erik.helin at oracle.com
Wed Jan 17 17:08:16 UTC 2018


On 01/17/2018 04:47 PM, Erik Österlund wrote:
> Hi Erik,
> 
> Looks good.

Thanks Erik for Reviewing!
Erik

> Thanks,
> /Erik
> 
> On 2018-01-17 16:33, Erik Helin wrote:
>> Hi all,
>>
>> this patch fixes the bug 'Concurrent System.gc() is "upgraded" to 
>> stop-the-world System.gc()' [0]. The bug occurs when all of the 
>> following conditions are true:
>> - the heap is full (more strictly, there are no regions available for
>>   allocations)
>> - the Java program executes System.gc()
>> - the flag -XX:+ExplicitGCInvokesConcurrent is set
>> If all of the above are true, then G1 will do an initial mark YC and 
>> (since 862c41 [1]) "upgrade" the gc to a full GC. This "upgrade" 
>> should not happen since the user has explicitly set the flag 
>> -XX:+ExplicitGCInvokesConcurrent. Since the heap is full, it is likely 
>> that the next allocation will trigger a full GC, but the concurrent 
>> marking could also finish quickly and free up memory in the cleanup 
>> phase.
>>
>> Patch:
>> http://cr.openjdk.java.net/~ehelin/JDK-8195158/00/index.html
>>
>> Bug:
>> https://bugs.openjdk.java.net/browse/JDK-8195158
>>
>> Testing:
>> - newly added regression test
>> - hs-tier1, hs-tier2, hs-tier3, hs-tier7 on
>>   - Linux x86-64
>>   - Mac x86-64
>>   - Windows x86-64
>>   - Solaris SPARC
>>
>> Thanks,
>> Erik
>>
>> [0]: https://bugs.openjdk.java.net/browse/JDK-8195158
>> [1]: http://hg.openjdk.java.net/jdk/hs/rev/862c41cf1c7f
> 



More information about the hotspot-gc-dev mailing list