< prev index next >

src/hotspot/share/gc/g1/g1Policy.cpp

Print this page
rev 59305 : imported patch 8243672-short-term-pause-time-ratio-calculation-off

@@ -116,10 +116,13 @@
 
   update_young_list_max_and_target_length();
   // We may immediately start allocating regions and placing them on the
   // collection set list. Initialize the per-collection set info
   _collection_set->start_incremental_building();
+
+  double now = os::elapsedTime();
+  _analytics->update_recent_gc_times(now, 0.0);
 }
 
 void G1Policy::note_gc_start() {
   phase_times()->note_gc_start();
 }

@@ -667,14 +670,12 @@
     // place we can safely ignore them here.
     uint regions_allocated = _collection_set->eden_region_length();
     double alloc_rate_ms = (double) regions_allocated / app_time_ms;
     _analytics->report_alloc_rate_ms(alloc_rate_ms);
 
-    double interval_ms =
-      (end_time_sec - _analytics->last_known_gc_end_time_sec()) * 1000.0;
+    _analytics->compute_pause_time_ratios(end_time_sec, pause_time_ms);
     _analytics->update_recent_gc_times(end_time_sec, pause_time_ms);
-    _analytics->compute_pause_time_ratio(interval_ms, pause_time_ms);
   }
 
   if (collector_state()->in_young_gc_before_mixed()) {
     assert(!this_pause_included_initial_mark, "The young GC before mixed is not allowed to be an initial mark GC");
     // This has been the young GC before we start doing mixed GCs. We already
< prev index next >