RFR: 8205022: ZGC: SoftReferences not always cleared before throwing OOME

Per Liden per.liden at oracle.com
Thu Jun 14 15:48:23 UTC 2018


Thanks Erik!

/Per

On 06/14/2018 05:40 PM, Erik Österlund wrote:
> Hi Per,
> 
> Looks good.
> 
> Thanks,
> /Erik
> 
> On 2018-06-14 11:42, Per Liden wrote:
>> The spec says "All soft references to softly-reachable objects are 
>> guaranteed to have been cleared before the virtual machine throws an 
>> OutOfMemoryError".
>>
>> We currently have a window/race in ZGC, where we can throw OOME before 
>> clearing all SoftReferences with a softly-reachable referent. The 
>> reason is that the current logic only guarantees that we wait with 
>> throwing OOME until the allocating thread have been part of a complete 
>> GC cycle, but there is no guarantee that the last GC cycle also 
>> cleared SoftReferences.
>>
>> This race is causing rare/intermittent failures in tier2 testing 
>> (TestSoftRerencesBahviorOnOOME).
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8205022
>> Webrev: http://cr.openjdk.java.net/~pliden/8205022/webrev.0/
>>
>> Testing: tier{1,2,3,4}
>>
>> /Per
> 



More information about the hotspot-gc-dev mailing list