@@ -629,7 +629,7 @@ double G1Policy::logged_cards_processing_time() const {
629629// Anything below that is considered to be zero
630630#define MIN_TIMER_GRANULARITY 0.0000001
631631
632- void G1Policy::record_young_collection_end (bool concurrent_operation_is_full_mark) {
632+ void G1Policy::record_young_collection_end (bool concurrent_operation_is_full_mark, bool evacuation_failure ) {
633633 G1GCPhaseTimes* p = phase_times ();
634634
635635 double start_time_sec = phase_times ()->cur_collection_start_sec ();
@@ -638,8 +638,6 @@ void G1Policy::record_young_collection_end(bool concurrent_operation_is_full_mar
638638
639639 G1GCPauseType this_pause = collector_state ()->young_gc_pause_type (concurrent_operation_is_full_mark);
640640
641- bool update_stats = should_update_gc_stats ();
642-
643641 if (G1GCPauseTypeHelper::is_concurrent_start_pause (this_pause)) {
644642 record_concurrent_mark_init_end ();
645643 } else {
@@ -654,6 +652,10 @@ void G1Policy::record_young_collection_end(bool concurrent_operation_is_full_mar
654652 app_time_ms = 1.0 ;
655653 }
656654
655+ // Evacuation failures skew the timing too much to be considered for some statistics updates.
656+ // We make the assumption that these are rare.
657+ bool update_stats = !evacuation_failure;
658+
657659 if (update_stats) {
658660 // We maintain the invariant that all objects allocated by mutator
659661 // threads will be allocated out of eden regions. So, we can use
@@ -668,7 +670,7 @@ void G1Policy::record_young_collection_end(bool concurrent_operation_is_full_mar
668670 _analytics->report_alloc_rate_ms (alloc_rate_ms);
669671 }
670672
671- record_pause (this_pause, start_time_sec, end_time_sec);
673+ record_pause (this_pause, start_time_sec, end_time_sec, evacuation_failure );
672674
673675 if (G1GCPauseTypeHelper::is_last_young_pause (this_pause)) {
674676 assert (!G1GCPauseTypeHelper::is_concurrent_start_pause (this_pause),
@@ -891,9 +893,9 @@ void G1Policy::report_ihop_statistics() {
891893 _ihop_control->print ();
892894}
893895
894- void G1Policy::record_young_gc_pause_end () {
896+ void G1Policy::record_young_gc_pause_end (bool evacuation_failed ) {
895897 phase_times ()->record_gc_pause_end ();
896- phase_times ()->print ();
898+ phase_times ()->print (evacuation_failed );
897899}
898900
899901double G1Policy::predict_base_elapsed_time_ms (size_t pending_cards,
@@ -1176,12 +1178,6 @@ void G1Policy::maybe_start_marking() {
11761178 }
11771179}
11781180
1179- bool G1Policy::should_update_gc_stats () {
1180- // Evacuation failures skew the timing too much to be considered for statistics updates.
1181- // We make the assumption that these are rare.
1182- return !_g1h->evacuation_failed ();
1183- }
1184-
11851181void G1Policy::update_gc_pause_time_ratios (G1GCPauseType gc_type, double start_time_sec, double end_time_sec) {
11861182
11871183 double pause_time_sec = end_time_sec - start_time_sec;
@@ -1199,13 +1195,14 @@ void G1Policy::update_gc_pause_time_ratios(G1GCPauseType gc_type, double start_t
11991195
12001196void G1Policy::record_pause (G1GCPauseType gc_type,
12011197 double start,
1202- double end) {
1198+ double end,
1199+ bool evacuation_failure) {
12031200 // Manage the MMU tracker. For some reason it ignores Full GCs.
12041201 if (gc_type != G1GCPauseType::FullGC) {
12051202 _mmu_tracker->add_pause (start, end);
12061203 }
12071204
1208- if (should_update_gc_stats () ) {
1205+ if (!evacuation_failure ) {
12091206 update_gc_pause_time_ratios (gc_type, start, end);
12101207 }
12111208
0 commit comments