RFR(S): 7098282: G1: assert(interval >= 0) failed: Sanity check, referencePolicy.cpp: 76

John Cuthbertson john.cuthbertson at oracle.com
Fri Oct 7 17:39:08 UTC 2011


Hi Everyone,

Can I have a couple of volunteers review the code changes for this CR? 
The webrev can be found at: 
http://cr.openjdk.java.net/~johnc/7098282/webrev.0/

Description:
This assert was being tripped because, during reference discovery in an 
evacuation pause, the value of the SoftReference master clock field 
became zero and so the timestamp interval was negative. The reason why 
the clock was zero was that another thread was in the process of copying 
the klass mirror for the SoftReference class (in which the statics are 
allocated). To resolve this issue I am maintaining a static shadow copy 
of the value of the SoftReference class' master clock and I use shadow 
copy in reference discovery and processing. This shadow copy is set when 
the Java field SoftReference::clock is set as well as a couple of 
strategic places (when discovery is enabled and right before processing 
the discovered soft references) in case the value of the Java field was 
modified using reflection or Unsafe access.

Testing: The failing test case with all collectors, the GC test suite 
with all collectors.

Thanks,

JohnC



More information about the hotspot-gc-dev mailing list