mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
6898948: G1: forensic instrumentation for out-of-bounds recent_avg_pause_time_ratio()
Added instrumentation and (temporary) assert in non-product mode; clipped the value when found out-of-bounds in product mode. Fix of original issue will follow collection of data from this instrumentation. Reviewed-by: jcoomes, tonyp
This commit is contained in:
parent
bedf908436
commit
241f0f0cd8
3 changed files with 65 additions and 2 deletions
|
@ -1516,8 +1516,31 @@ void G1CollectorPolicy::record_collection_pause_end(bool abandoned) {
|
|||
(end_time_sec - _recent_prev_end_times_for_all_gcs_sec->oldest()) * 1000.0;
|
||||
update_recent_gc_times(end_time_sec, elapsed_ms);
|
||||
_recent_avg_pause_time_ratio = _recent_gc_times_ms->sum()/interval_ms;
|
||||
// using 1.01 to account for floating point inaccuracies
|
||||
assert(recent_avg_pause_time_ratio() < 1.01, "All GC?");
|
||||
if (recent_avg_pause_time_ratio() < 0.0 ||
|
||||
(recent_avg_pause_time_ratio() - 1.0 > 0.0)) {
|
||||
#ifndef PRODUCT
|
||||
// Dump info to allow post-facto debugging
|
||||
gclog_or_tty->print_cr("recent_avg_pause_time_ratio() out of bounds");
|
||||
gclog_or_tty->print_cr("-------------------------------------------");
|
||||
gclog_or_tty->print_cr("Recent GC Times (ms):");
|
||||
_recent_gc_times_ms->dump();
|
||||
gclog_or_tty->print_cr("(End Time=%3.3f) Recent GC End Times (s):", end_time_sec);
|
||||
_recent_prev_end_times_for_all_gcs_sec->dump();
|
||||
gclog_or_tty->print_cr("GC = %3.3f, Interval = %3.3f, Ratio = %3.3f",
|
||||
_recent_gc_times_ms->sum(), interval_ms, recent_avg_pause_time_ratio());
|
||||
// TEMPORARY: In debug mode, terminate the JVM, so nightly testing explicitly
|
||||
// flags the sighting by failing the test.
|
||||
assert(false, "Debugging data for CR 6898948 has been dumped above");
|
||||
#else // PRODUCT
|
||||
// Clip ratio between 0.0 and 1.0
|
||||
if (_recent_avg_pause_time_ratio < 0.0) {
|
||||
_recent_avg_pause_time_ratio = 0.0;
|
||||
} else {
|
||||
assert(_recent_avg_pause_time_ratio - 1.0 > 0.0, "Ctl-point invariant");
|
||||
_recent_avg_pause_time_ratio = 1.0;
|
||||
}
|
||||
#endif // PRODUCT
|
||||
}
|
||||
}
|
||||
|
||||
if (G1PolicyVerbose > 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue