--- old/src/hotspot/share/gc/g1/g1Analytics.cpp 2019-12-04 15:38:55.882621296 +0100 +++ new/src/hotspot/share/gc/g1/g1Analytics.cpp 2019-12-04 15:38:55.666619647 +0100 @@ -94,6 +94,7 @@ _rs_length_seq(new TruncatedSeq(TruncatedSeqLength)), _cost_per_byte_ms_during_cm_seq(new TruncatedSeq(TruncatedSeqLength)), _recent_prev_end_times_for_all_gcs_sec(new TruncatedSeq(NumPrevPausesForHeuristics)), + _survivor_ratio(new TruncatedSeq(TruncatedSeqLength)), _recent_avg_pause_time_ratio(0.0), _last_pause_time_ratio(0.0) { @@ -119,6 +120,8 @@ // start conservatively (around 50ms is about right) _concurrent_mark_remark_times_ms->add(0.05); _concurrent_mark_cleanup_times_ms->add(0.20); + + _survivor_ratio->add(0.5); } bool G1Analytics::enough_samples_available(TruncatedSeq const* seq) const { @@ -228,6 +231,10 @@ _rs_length_seq->add(rs_length); } +void G1Analytics::report_survivor_ratio(double ratio) { + _survivor_ratio->add(ratio); +} + double G1Analytics::predict_alloc_rate_ms() const { return predict_zero_bounded(_alloc_rate_ms_seq); } @@ -284,6 +291,10 @@ } } +double G1Analytics::predict_survivor_ratio() const { + return predict_in_unit_interval(_survivor_ratio); +} + double G1Analytics::predict_constant_other_time_ms() const { return predict_zero_bounded(_constant_other_time_ms_seq); }