@@ -586,6 +586,20 @@ void G1RemSet::refine_card_concurrently(jbyte* card_ptr,
586
586
return ;
587
587
}
588
588
589
+ // While we are processing RSet buffers during the collection, we
590
+ // actually don't want to scan any cards on the collection set,
591
+ // since we don't want to update remembered sets with entries that
592
+ // point into the collection set, given that live objects from the
593
+ // collection set are about to move and such entries will be stale
594
+ // very soon. This change also deals with a reliability issue which
595
+ // involves scanning a card in the collection set and coming across
596
+ // an array that was being chunked and looking malformed. Note,
597
+ // however, that if evacuation fails, we have to scan any objects
598
+ // that were not moved and create any missing entries.
599
+ if (r->in_collection_set ()) {
600
+ return ;
601
+ }
602
+
589
603
// The result from the hot card cache insert call is either:
590
604
// * pointer to the current card
591
605
// (implying that the current card is not 'hot'),
@@ -610,7 +624,8 @@ void G1RemSet::refine_card_concurrently(jbyte* card_ptr,
610
624
611
625
// Check whether the region formerly in the cache should be
612
626
// ignored, as discussed earlier for the original card. The
613
- // region could have been freed while in the cache.
627
+ // region could have been freed while in the cache. The cset is
628
+ // not relevant here, since we're in concurrent phase.
614
629
if (!r->is_old_or_humongous ()) {
615
630
return ;
616
631
}
0 commit comments