From 74ca6ca25ba3ece0c92bf2c6e4f940996785c9a3 Mon Sep 17 00:00:00 2001 From: Ivan Walulya Date: Thu, 7 Jul 2022 15:09:30 +0000 Subject: [PATCH] 8289800: G1: G1CollectionSet::finalize_young_part clears survivor list too early Reviewed-by: ayang, tschatzl --- src/hotspot/share/gc/g1/g1CollectionSet.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CollectionSet.cpp b/src/hotspot/share/gc/g1/g1CollectionSet.cpp index f44679f8aae..012369ded6b 100644 --- a/src/hotspot/share/gc/g1/g1CollectionSet.cpp +++ b/src/hotspot/share/gc/g1/g1CollectionSet.cpp @@ -415,9 +415,6 @@ double G1CollectionSet::finalize_young_part(double target_pause_time_ms, G1Survi verify_young_cset_indices(); - // Clear the fields that point to the survivor list - they are all young now. - survivors->convert_to_eden(); - _bytes_used_before = _inc_bytes_used_before; // The number of recorded young regions is the incremental @@ -433,6 +430,9 @@ double G1CollectionSet::finalize_young_part(double target_pause_time_ms, G1Survi eden_region_length, survivor_region_length, predicted_eden_time, predicted_base_time_ms, target_pause_time_ms, remaining_time_ms); + // Clear the fields that point to the survivor list - they are all young now. + survivors->convert_to_eden(); + phase_times()->record_young_cset_choice_time_ms((Ticks::now() - start_time).seconds() * 1000.0); return remaining_time_ms;