--- old/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2018-04-19 15:49:12.015849167 +0200 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2018-04-19 15:49:11.730840382 +0200 @@ -4041,12 +4041,17 @@ } void G1CollectedHeap::post_evacuate_collection_set(EvacuationInfo& evacuation_info, G1ParScanThreadStateSet* per_thread_states) { + // Also cleans the card table from temporary duplicate detection information used + // during UpdateRS/ScanRS. + g1_rem_set()->cleanup_after_oops_into_collection_set_do(); + // Process any discovered reference objects - we have // to do this _before_ we retire the GC alloc regions // as we may have to copy some 'reachable' referent // objects (and their reachable sub-graphs) that were // not copied during the pause. process_discovered_references(per_thread_states); + enqueue_discovered_references(per_thread_states); G1STWIsAliveClosure is_alive(this); G1KeepAliveClosure keep_alive(this); @@ -4069,8 +4074,6 @@ g1_policy()->phase_times()->record_string_dedup_fixup_time(fixup_time_ms); } - g1_rem_set()->cleanup_after_oops_into_collection_set_do(); - if (evacuation_failed()) { restore_after_evac_failure(); @@ -4082,15 +4085,6 @@ _preserved_marks_set.assert_empty(); - // Enqueue any remaining references remaining on the STW - // reference processor's discovered lists. We need to do - // this after the card table is cleaned (and verified) as - // the act of enqueueing entries on to the pending list - // will log these updates (and dirty their associated - // cards). We need these updates logged to update any - // RSets. - enqueue_discovered_references(per_thread_states); - _allocator->release_gc_alloc_regions(evacuation_info); merge_per_thread_state_info(per_thread_states); --- old/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp 2018-04-19 15:49:13.239886894 +0200 +++ new/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp 2018-04-19 15:49:12.959878264 +0200 @@ -397,6 +397,8 @@ debug_time("Code Roots Fixup", _cur_collection_code_root_fixup_time_ms); + debug_time("Clear Card Table", _cur_clear_ct_time_ms); + debug_time_for_reference("Reference Processing", _cur_ref_proc_time_ms); _ref_phase_times.print_all_references(2, false); @@ -408,8 +410,6 @@ debug_phase(_gc_par_phases[StringDedupTableFixup]); } - debug_time("Clear Card Table", _cur_clear_ct_time_ms); - if (G1CollectedHeap::heap()->evacuation_failed()) { debug_time("Evacuation Failure", evac_fail_handling); trace_time("Recalculate Used", _cur_evac_fail_recalc_used);