8200723: Suppress rs_length and predicted_cards sampling during mixed gcs
authortschatzl
Wed, 18 Apr 2018 11:36:48 +0200
changeset 49805 1ccbcd88f66c
parent 49804 7593b16d0d20
child 49806 2d62570a615c
8200723: Suppress rs_length and predicted_cards sampling during mixed gcs Summary: Due to the impact of these measurements on pause time, their high difference to other collections during mixed collections, and their non-use during mixed collections, do not use rs_length and predicted_cards measurements done during mixed gc for the predictor. This avoids the young gen sizing after the mixed phase to be negatively affected by mixed collections. Reviewed-by: kbarrett, sjohanss
src/hotspot/share/gc/g1/g1Policy.cpp
--- a/src/hotspot/share/gc/g1/g1Policy.cpp	Wed Apr 18 11:36:48 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1Policy.cpp	Wed Apr 18 11:36:48 2018 +0200
@@ -686,8 +686,14 @@
 
     _analytics->report_constant_other_time_ms(constant_other_time_ms(pause_time_ms));
 
-    _analytics->report_pending_cards((double) _pending_cards);
-    _analytics->report_rs_lengths((double) _max_rs_lengths);
+    // Do not update RS lengths and the number of pending cards with information from mixed gc:
+    // these are is wildly different to during young only gc and mess up young gen sizing right
+    // after the mixed gc phase.
+    // During mixed gc we do not use them for young gen sizing.
+    if (this_pause_was_young_only) {
+      _analytics->report_pending_cards((double) _pending_cards);
+      _analytics->report_rs_lengths((double) _max_rs_lengths);
+    }
   }
 
   assert(!(this_pause_included_initial_mark && collector_state()->mark_or_rebuild_in_progress()),