8295156: G1: Improve constant other time calculation

Co-authored-by: Ivan Walulya <iwalulya@openjdk.org>
Reviewed-by: kbarrett, iwalulya
This commit is contained in:
Thomas Schatzl 2022-10-14 13:53:52 +00:00
parent 786ce1c27b
commit 312985eea6
2 changed files with 5 additions and 2 deletions

View File

@ -390,7 +390,10 @@ class G1GCPhaseTimes : public CHeapObj<mtGC> {
}
double cur_collection_par_time_ms() {
return _cur_collection_initial_evac_time_ms + _cur_optional_evac_time_ms;
return _cur_collection_initial_evac_time_ms +
_cur_optional_evac_time_ms +
_cur_merge_heap_roots_time_ms +
_cur_optional_merge_heap_roots_time_ms;
}
double cur_expand_heap_time_ms() {

View File

@ -685,7 +685,7 @@ double G1Policy::other_time_ms(double pause_time_ms) const {
}
double G1Policy::constant_other_time_ms(double pause_time_ms) const {
return other_time_ms(pause_time_ms) - phase_times()->total_rebuild_freelist_time_ms();
return other_time_ms(pause_time_ms) - (young_other_time_ms() + non_young_other_time_ms());
}
bool G1Policy::about_to_start_mixed_phase() const {