diff --git a/src/hotspot/share/gc/g1/g1RemSet.cpp b/src/hotspot/share/gc/g1/g1RemSet.cpp index 2a7077d3724ff..09b5f4ee80e75 100644 --- a/src/hotspot/share/gc/g1/g1RemSet.cpp +++ b/src/hotspot/share/gc/g1/g1RemSet.cpp @@ -849,7 +849,7 @@ class G1ScanCollectionSetRegionClosure : public HeapRegionClosure { // Scan the code root list attached to the current region r->code_roots_do(&cl); - _code_roots_scanned = cl.count(); + _code_roots_scanned += cl.count(); event.commit(GCId::current(), _worker_id, G1GCPhaseTimes::phase_name(_code_roots_phase)); }