< prev index next >
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
Print this page
rev 7743 : 8069034: gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java nightly failure
Summary: When checking for humongous objects to reclaim, we dirty cards that might belong to freed regions. Fixed by checking the region before dirtying.
Reviewed-by:
*** 3523,3537 ****
--- 3523,3542 ----
G1SATBCardTableLoggingModRefBS* bs = g1h->g1_barrier_set();
HeapRegionRemSetIterator hrrs(r->rem_set());
size_t card_index;
while (hrrs.has_next(card_index)) {
jbyte* card_ptr = (jbyte*)bs->byte_for_index(card_index);
+ // The remembered set might contain references to already freed
+ // regions. Filter out such entries to avoid failing card table
+ // verification.
+ if (!g1h->heap_region_containing(bs->addr_for(card_ptr))->is_free()) {
if (*card_ptr != CardTableModRefBS::dirty_card_val()) {
*card_ptr = CardTableModRefBS::dirty_card_val();
_dcq.enqueue(card_ptr);
}
}
+ }
r->rem_set()->clear_locked();
}
assert(r->rem_set()->is_empty(), "At this point any humongous candidate remembered set must be empty.");
g1h->register_humongous_region_with_in_cset_fast_test(region_idx);
_candidate_humongous++;
< prev index next >