Skip to content


Browse files Browse the repository at this point in the history
8270842: G1: Only young regions need to redirty outside references in…
… remset.

Reviewed-by: tschatzl
  • Loading branch information
Hamlin Li committed Aug 6, 2021
1 parent f4cf2f7 commit cc61520
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/hotspot/share/gc/g1/g1EvacFailure.cpp
Expand Up @@ -80,6 +80,7 @@ class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
G1CollectedHeap* _g1h;
G1ConcurrentMark* _cm;
HeapRegion* _hr;
const bool _is_young;
size_t _marked_bytes;
UpdateLogBuffersDeferred* _log_buffer_cl;
bool _during_concurrent_start;
Expand All @@ -94,6 +95,7 @@ class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
Expand Down Expand Up @@ -140,19 +142,14 @@ class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
_marked_bytes += (obj_size * HeapWordSize);

// While we were processing RSet buffers during the collection,
// we actually didn't scan any cards on the collection set,
// since we didn't want to update remembered sets with entries
// that point into the collection set, given that live objects
// from the collection set are about to move and such entries
// will be stale very soon.
// This change also dealt with a reliability issue which
// involved scanning a card in the collection set and coming
// across an array that was being chunked and looking malformed.
// The problem is that, if evacuation fails, we might have
// remembered set entries missing given that we skipped cards on
// the collection set. So, we'll recreate such entries now.
// During evacuation failure we do not record inter-region
// references referencing regions that need a remembered set
// update originating from young regions (including eden) that
// failed evacuation. Make up for that omission now by rescanning
// these failed objects.
if (_is_young) {

HeapWord* obj_end = obj_addr + obj_size;
_last_forwarded_object_end = obj_end;
Expand Down

1 comment on commit cc61520

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.