--- old/src/hotspot/share/gc/g1/g1Policy.hpp 2020-06-10 10:12:06.937112094 +0200 +++ new/src/hotspot/share/gc/g1/g1Policy.hpp 2020-06-10 10:12:06.845108933 +0200 @@ -61,7 +61,8 @@ void update_ihop_prediction(double mutator_time_s, size_t mutator_alloc_bytes, size_t young_gen_size, - bool this_gc_was_young_only); + bool this_gc_was_young_only, + bool this_gc_included_initial_mark); void report_ihop_statistics(); G1Predictions _predictor; @@ -77,7 +78,6 @@ jlong _collection_pause_end_millis; uint _young_list_target_length; - uint _young_list_fixed_length; // The max number of regions we can extend the eden by while the GC // locker is active. This should be >= _young_list_target_length; @@ -170,6 +170,10 @@ private: G1CollectionSet* _collection_set; + + bool next_gc_should_be_mixed(const char* true_action_str, + const char* false_action_str) const; + double average_time_ms(G1GCPhaseTimes::GCParPhases phase) const; double other_time_ms(double pause_time_ms) const; @@ -189,44 +193,42 @@ double _mark_remark_start_sec; double _mark_cleanup_start_sec; - // Updates the internal young list maximum and target lengths. Returns the - // unbounded young list target length. If no rs_length parameter is passed, + // Updates the internal young gen maximum and target lengths. Returns the + // unbounded young target length. If no rs_length parameter is passed, // predict the RS length using the prediction model, otherwise use the // given rs_length as the prediction. - uint update_young_list_max_and_target_length(); - uint update_young_list_max_and_target_length(size_t rs_length); + uint update_young_max_and_target_length(); + uint update_young_max_and_target_length(size_t rs_length); // Update the young list target length either by setting it to the // desired fixed value or by calculating it using G1's pause // prediction model. // Returns the unbounded young list target length. - uint update_young_list_target_length(size_t rs_length); + uint update_young_target_length(size_t rs_length); - // Calculate and return the minimum desired young list target - // length. This is the minimum desired young list length according - // to the user's inputs. - uint calculate_young_list_desired_min_length(uint base_min_length) const; - - // Calculate and return the maximum desired young list target - // length. This is the maximum desired young list length according - // to the user's inputs. - uint calculate_young_list_desired_max_length() const; - - // Calculate and return the maximum young list target length that - // can fit into the pause time goal. The parameters are: rs_length - // represent the prediction of how large the young RSet lengths will - // be, base_min_length is the already existing number of regions in - // the young list, min_length and max_length are the desired min and - // max young list length according to the user's inputs. - uint calculate_young_list_target_length(size_t rs_length, - uint base_min_length, - uint desired_min_length, - uint desired_max_length) const; - - // Result of the bounded_young_list_target_length() method, containing both the - // bounded as well as the unbounded young list target lengths in this order. - typedef Pair YoungTargetLengths; - YoungTargetLengths young_list_target_lengths(size_t rs_length) const; + // Calculate and return the minimum desired eden length based on the MMU target. + uint calculate_desired_eden_length_by_mmu() const; + + // Calculate and return the desired eden length that can fit into the pause time goal. + // The parameters are: rs_length represents the prediction of how large the + // young RSet lengths will be, min_eden_length and max_eden_length are the bounds + // (inclusive) within eden can grow. + uint calculate_desired_eden_length_by_pause(double base_time_ms, + uint min_eden_length, + uint max_eden_length) const; + + // Calculates the desired eden length before mixed gc so that after adding the + // minimum amount of old gen regions from the collection set, the eden fits into + // the pause time goal. + uint calculate_desired_eden_length_before_mixed(double survivor_base_time_ms, + uint min_eden_length, + uint max_eden_length) const; + + // Calculate desired young length based on current situation without taking actually + // available free regions into account. + uint calculate_young_desired_length(size_t rs_length) const; + // Limit the given desired young length to available free regions. + uint calculate_young_target_length(uint desired_young_length) const; void update_rs_length_prediction(); void update_rs_length_prediction(size_t prediction); @@ -335,9 +337,6 @@ void print_phases(); - bool next_gc_should_be_mixed(const char* true_action_str, - const char* false_action_str) const; - // Calculate and return the number of initial and optional old gen regions from // the given collection set candidates and the remaining time. void calculate_old_collection_set_regions(G1CollectionSetCandidates* candidates,