Skip to content

Commit 2d4185f

Browse files
committed
8332717: ZGC: Division by zero in heuristics
Reviewed-by: aboldtch, shade
1 parent fad6644 commit 2d4185f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/hotspot/share/gc/z/zDirector.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,10 @@ static bool rule_major_allocation_rate(const ZDirectorStats& stats) {
524524
}
525525

526526
static double calculate_young_to_old_worker_ratio(const ZDirectorStats& stats) {
527+
if (!stats._old_stats._cycle._is_time_trustable) {
528+
return 1.0;
529+
}
530+
527531
const double young_gc_time = gc_time(stats._young_stats);
528532
const double old_gc_time = gc_time(stats._old_stats);
529533
const size_t reclaimed_per_young_gc = stats._young_stats._stat_heap._reclaimed_avg;

0 commit comments

Comments
 (0)