8210463: Recalculate_used() always sets time taken in G1GCPhaseTimes

Reviewed-by: phh, sjohanss
This commit is contained in:
Thomas Schatzl 2018-09-11 09:13:37 +02:00
parent 694380add3
commit 093c837c85

View File

@ -1950,12 +1950,8 @@ public:
};
size_t G1CollectedHeap::recalculate_used() const {
double recalculate_used_start = os::elapsedTime();
SumUsedClosure blk;
heap_region_iterate(&blk);
g1_policy()->phase_times()->record_evac_fail_recalc_used_time((os::elapsedTime() - recalculate_used_start) * 1000.0);
return blk.result();
}
@ -3013,7 +3009,10 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
g1_policy()->phase_times()->record_start_new_cset_time_ms((os::elapsedTime() - start) * 1000.0);
if (evacuation_failed()) {
double recalculate_used_start = os::elapsedTime();
set_used(recalculate_used());
g1_policy()->phase_times()->record_evac_fail_recalc_used_time((os::elapsedTime() - recalculate_used_start) * 1000.0);
if (_archive_allocator != NULL) {
_archive_allocator->clear_used();
}