RFR: 8237363: Remove automatic is in heap verification in OopIterateClosure

Per Liden per.liden at oracle.com
Thu Jan 23 13:01:38 UTC 2020


On 1/23/20 11:24 AM, Thomas Schatzl wrote:
>>   It is true that other code typically has many
>>> other asserts that would fail anyway, but it would be an additional 
>>> safety net when writing new closures.
>> It's a safety net that works for G1, but almost always is incorrectly 
>> trips in the assert with ZGC.
> It works for all GCs (+leak profiler) but ZGC given the webrev. This 
> does not suggest that this is GC-specific functionality at all. The 
> verification method also seems to only uses an innocuous 
> CollectedHeap::is_in() call that seems something very basic to support 
> for a GC.
> What is it in ZGC that prevents CollectedHeap::is_in() to return the 
> expected value?

ZGC is returning the expected value. The problem here is that the 
verification happens _before_ the closure is applied, i.e. it asks if an 
oop that has not yet been fixed points into the heap. ZGC's is_in() is 
precise (i.e. cares about which heap view an oop points into), so an oop 
with a bad color is not considered to point into the heap. It's a 
feature, as it allows for exact verification and will catch oops with 
bad colors.


> And the opt-out method does have been designed for unusual cases.
> Thanks,
>    Thomas

More information about the hotspot-gc-dev mailing list