Skip to content

Commit

Permalink
8332717: ZGC: Division by zero in heuristics
Browse files Browse the repository at this point in the history
Reviewed-by: shade
Backport-of: 2d4185f4f1def7c32d1a556521e26ec656234220
  • Loading branch information
fisk committed Jun 25, 2024
1 parent 08c7c38 commit 37ebece
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/hotspot/share/gc/z/zDirector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,10 @@ static bool rule_major_allocation_rate(const ZDirectorStats& stats) {
}

static double calculate_young_to_old_worker_ratio(const ZDirectorStats& stats) {
if (!stats._old_stats._cycle._is_time_trustable) {
return 1.0;
}

const double young_gc_time = gc_time(stats._young_stats);
const double old_gc_time = gc_time(stats._old_stats);
const size_t reclaimed_per_young_gc = stats._young_stats._stat_heap._reclaimed_avg;
Expand Down

0 comments on commit 37ebece

Please sign in to comment.