RFR (XS) 8141422: G1 eager reclaim card dirtying may dirty outside of allocated objects

Mikael Gerdin mikael.gerdin at oracle.com
Wed Nov 4 13:39:25 UTC 2015

Hi Thomas,

On 2015-11-04 14:35, Thomas Schatzl wrote:
> Hi Mikael,
> On Wed, 2015-11-04 at 14:20 +0100, Mikael Gerdin wrote:
>> Hi all,
>> We've discovered a small issue with the card dirtying used to support
>> eager reclaim of humongous objects.
>> The problem is that when remembered set iteration yields a card which
>> does not correspond to the allocated part of a region then that cards
>> should be ignored. Currently the code only detects this situation when
> Just fyi, the remembered set may contain such stale entries. A normal
> Java application would not dirty such a card.


> When we talked about it, the problem has been dirty card verification I
> think. I am not sure if there is some serious issue with that - walking
> that card later should always filter it out imo.

I agree that it's just an issue with verification but it's nice to get 
rid of the false negatives it creates when running with verification 

>> the ignored card covers an otherwise free region but this check needs to
>> be extended to also check if the card corresponds to unallocated memory
>> in an otherwise used region.
>> An example of this situation is that the card corresponds to a part of
>> memory above _top in a humongous region and this is what we are seeing
>> in some test cases.
>> My suggested fix is to check "is_in_closed_subset" which will look up
>> the corresponding region and verify that the address is within the
>> allocated bounds of that region.
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8141422
>> Webrev: http://cr.openjdk.java.net/~mgerdin/8141422/webrev.0/
>> Testing: JPRT
>    looks good to me.
> (Note that I fixed the typo in the bug summary)

Thanks, I'll make sure to update the changeset comment as well.

> Thomas

More information about the hotspot-gc-dev mailing list