--- old/src/hotspot/share/gc/g1/g1Policy.cpp 2020-02-17 17:22:57.008272821 +0800 +++ new/src/hotspot/share/gc/g1/g1Policy.cpp 2020-02-17 17:22:57.010272893 +0800 @@ -679,6 +679,9 @@ _analytics->compute_pause_time_ratio(interval_ms, pause_time_ms); } + if (collector_state()->finish_of_mixed_gc()) { + collector_state()->set_finish_of_mixed_gc(false); + } if (collector_state()->in_young_gc_before_mixed()) { assert(!this_pause_included_initial_mark, "The young GC before mixed is not allowed to be an initial mark GC"); // This has been the young GC before we start doing mixed GCs. We already @@ -692,6 +695,7 @@ if (!next_gc_should_be_mixed("continue mixed GCs", "do not continue mixed GCs")) { collector_state()->set_in_young_only_phase(true); + collector_state()->set_finish_of_mixed_gc(true); clear_collection_set_candidates(); maybe_start_marking(); @@ -1411,3 +1415,10 @@ // the survivor regions from this evacuation pause as 'young' // at the start of the next. } + +size_t G1Policy::minimum_desired_bytes_after_concurrent_mark(size_t used_bytes) { + size_t minimum_desired_buffer_size = _ihop_control->predict_unstrained_buffer_size(); + return minimum_desired_buffer_size != 0 ? + minimum_desired_buffer_size : _young_list_max_length * HeapRegion::GrainBytes + + _reserve_regions * HeapRegion::GrainBytes + used_bytes; +}