< prev index next >
src/share/vm/gc/g1/g1CollectedHeap.cpp
Print this page
rev 10739 : 8153745: Avoid spawning G1ParPreserveCMReferentsTask when there is no work to be done
Reviewed-by:
*** 4438,4448 ****
double ref_proc_time = os::elapsedTime() - ref_proc_start;
g1_policy()->phase_times()->record_ref_proc_time(ref_proc_time * 1000.0);
}
void G1CollectedHeap::preserve_cm_referents(G1ParScanThreadStateSet* per_thread_states) {
- double preserve_cm_referents_start = os::elapsedTime();
// Any reference objects, in the collection set, that were 'discovered'
// by the CM ref processor should have already been copied (either by
// applying the external root copy closure to the discovered lists, or
// by following an RSet entry).
//
--- 4438,4447 ----
*** 4459,4478 ****
//
// We also need to do this copying before we process the reference
// objects discovered by the STW ref processor in case one of these
// referents points to another object which is also referenced by an
// object discovered by the STW ref processor.
uint no_of_gc_workers = workers()->active_workers();
-
G1ParPreserveCMReferentsTask keep_cm_referents(this,
per_thread_states,
no_of_gc_workers,
_task_queues);
workers()->run_task(&keep_cm_referents);
! g1_policy()->phase_times()->record_preserve_cm_referents_time_ms((os::elapsedTime() - preserve_cm_referents_start) * 1000.0);
}
// Weak Reference processing during an evacuation pause (part 1).
void G1CollectedHeap::process_discovered_references(G1ParScanThreadStateSet* per_thread_states) {
double ref_proc_start = os::elapsedTime();
--- 4458,4481 ----
//
// We also need to do this copying before we process the reference
// objects discovered by the STW ref processor in case one of these
// referents points to another object which is also referenced by an
// object discovered by the STW ref processor.
+ double preserve_cm_referents_time = 0.0;
+ if (_ref_processor_cm->has_discovered_references()) {
+ double preserve_cm_referents_start = os::elapsedTime();
uint no_of_gc_workers = workers()->active_workers();
G1ParPreserveCMReferentsTask keep_cm_referents(this,
per_thread_states,
no_of_gc_workers,
_task_queues);
workers()->run_task(&keep_cm_referents);
+ preserve_cm_referents_time = os::elapsedTime() - preserve_cm_referents_start;
+ }
! g1_policy()->phase_times()->record_preserve_cm_referents_time_ms(preserve_cm_referents_time * 1000.0);
}
// Weak Reference processing during an evacuation pause (part 1).
void G1CollectedHeap::process_discovered_references(G1ParScanThreadStateSet* per_thread_states) {
double ref_proc_start = os::elapsedTime();
< prev index next >