src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp

changeset 1521
89f1b9ae8991
parent 1478
fc06cd9b42c7
child 1522
23b9a8d315fc
     1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Tue Nov 10 11:32:48 2009 -0800
     1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Fri Nov 13 11:55:26 2009 -0800
     1.3 @@ -1516,8 +1516,31 @@
     1.4        (end_time_sec - _recent_prev_end_times_for_all_gcs_sec->oldest()) * 1000.0;
     1.5      update_recent_gc_times(end_time_sec, elapsed_ms);
     1.6      _recent_avg_pause_time_ratio = _recent_gc_times_ms->sum()/interval_ms;
     1.7 -    // using 1.01 to account for floating point inaccuracies
     1.8 -    assert(recent_avg_pause_time_ratio() < 1.01, "All GC?");
     1.9 +    if (recent_avg_pause_time_ratio() < 0.0 ||
    1.10 +        (recent_avg_pause_time_ratio() - 1.0 > 0.0)) {
    1.11 +#ifndef PRODUCT
    1.12 +      // Dump info to allow post-facto debugging
    1.13 +      gclog_or_tty->print_cr("recent_avg_pause_time_ratio() out of bounds");
    1.14 +      gclog_or_tty->print_cr("-------------------------------------------");
    1.15 +      gclog_or_tty->print_cr("Recent GC Times (ms):");
    1.16 +      _recent_gc_times_ms->dump();
    1.17 +      gclog_or_tty->print_cr("(End Time=%3.3f) Recent GC End Times (s):", end_time_sec);
    1.18 +      _recent_prev_end_times_for_all_gcs_sec->dump();
    1.19 +      gclog_or_tty->print_cr("GC = %3.3f, Interval = %3.3f, Ratio = %3.3f",
    1.20 +                             _recent_gc_times_ms->sum(), interval_ms, recent_avg_pause_time_ratio());
    1.21 +      // TEMPORARY: In debug mode, terminate the JVM, so nightly testing explicitly
    1.22 +      // flags the sighting by failing the test.
    1.23 +      assert(false, "Debugging data for CR 6898948 has been dumped above");
    1.24 +#else  // PRODUCT
    1.25 +      // Clip ratio between 0.0 and 1.0
    1.26 +      if (_recent_avg_pause_time_ratio < 0.0) {
    1.27 +        _recent_avg_pause_time_ratio = 0.0;
    1.28 +      } else {
    1.29 +        assert(_recent_avg_pause_time_ratio - 1.0 > 0.0, "Ctl-point invariant");
    1.30 +        _recent_avg_pause_time_ratio = 1.0;
    1.31 +      }
    1.32 +#endif  // PRODUCT
    1.33 +    }
    1.34    }
    1.35  
    1.36    if (G1PolicyVerbose > 1) {

mercurial