8297584: G1 parallel phase event for scan heap roots is sent too often
Reviewed-by: tschatzl, ayang
This commit is contained in:
parent
be4245e814
commit
a1f4db55c5
@ -683,8 +683,7 @@ class G1ScanHRForRegionClosure : public HeapRegionClosure {
|
||||
_blocks_scanned++;
|
||||
}
|
||||
|
||||
void scan_heap_roots(HeapRegion* r) {
|
||||
EventGCPhaseParallel event;
|
||||
void scan_heap_roots(HeapRegion* r) {
|
||||
uint const region_idx = r->hrm_index();
|
||||
|
||||
ResourceMark rm;
|
||||
@ -725,8 +724,6 @@ class G1ScanHRForRegionClosure : public HeapRegionClosure {
|
||||
}
|
||||
_chunks_claimed++;
|
||||
}
|
||||
|
||||
event.commit(GCId::current(), _worker_id, G1GCPhaseTimes::phase_name(G1GCPhaseTimes::ScanHR));
|
||||
}
|
||||
|
||||
public:
|
||||
@ -780,9 +777,12 @@ void G1RemSet::scan_heap_roots(G1ParScanThreadState* pss,
|
||||
G1GCPhaseTimes::GCParPhases scan_phase,
|
||||
G1GCPhaseTimes::GCParPhases objcopy_phase,
|
||||
bool remember_already_scanned_cards) {
|
||||
EventGCPhaseParallel event;
|
||||
G1ScanHRForRegionClosure cl(_scan_state, pss, worker_id, scan_phase, remember_already_scanned_cards);
|
||||
_scan_state->iterate_dirty_regions_from(&cl, worker_id);
|
||||
|
||||
event.commit(GCId::current(), worker_id, G1GCPhaseTimes::phase_name(scan_phase));
|
||||
|
||||
G1GCPhaseTimes* p = _g1p->phase_times();
|
||||
|
||||
p->record_or_add_time_secs(objcopy_phase, worker_id, cl.rem_set_trim_partially_time().seconds());
|
||||
@ -816,16 +816,12 @@ class G1ScanCollectionSetRegionClosure : public HeapRegionClosure {
|
||||
Tickspan _rem_set_opt_trim_partially_time;
|
||||
|
||||
void scan_opt_rem_set_roots(HeapRegion* r) {
|
||||
EventGCPhaseParallel event;
|
||||
|
||||
G1OopStarChunkedList* opt_rem_set_list = _pss->oops_into_optional_region(r);
|
||||
|
||||
G1ScanCardClosure scan_cl(G1CollectedHeap::heap(), _pss, _opt_roots_scanned);
|
||||
G1ScanRSForOptionalClosure cl(G1CollectedHeap::heap(), &scan_cl);
|
||||
_opt_refs_scanned += opt_rem_set_list->oops_do(&cl, _pss->closures()->strong_oops());
|
||||
_opt_refs_memory_used += opt_rem_set_list->used_memory();
|
||||
|
||||
event.commit(GCId::current(), _worker_id, G1GCPhaseTimes::phase_name(_scan_phase));
|
||||
}
|
||||
|
||||
public:
|
||||
@ -853,13 +849,15 @@ public:
|
||||
// The individual references for the optional remembered set are per-worker, so we
|
||||
// always need to scan them.
|
||||
if (r->has_index_in_opt_cset()) {
|
||||
EventGCPhaseParallel event;
|
||||
G1EvacPhaseWithTrimTimeTracker timer(_pss, _rem_set_opt_root_scan_time, _rem_set_opt_trim_partially_time);
|
||||
scan_opt_rem_set_roots(r);
|
||||
|
||||
event.commit(GCId::current(), _worker_id, G1GCPhaseTimes::phase_name(_scan_phase));
|
||||
}
|
||||
|
||||
if (_scan_state->claim_collection_set_region(region_idx)) {
|
||||
EventGCPhaseParallel event;
|
||||
|
||||
G1EvacPhaseWithTrimTimeTracker timer(_pss, _code_root_scan_time, _code_trim_partially_time);
|
||||
// Scan the code root list attached to the current region
|
||||
r->code_roots_do(_pss->closures()->weak_codeblobs());
|
||||
|
Loading…
x
Reference in New Issue
Block a user