Commit f36b3b4 1 parent 4f6c506 commit f36b3b4 Copy full SHA for f36b3b4
File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -535,6 +535,19 @@ static double calculate_young_to_old_worker_ratio(const ZDirectorStats& stats) {
535
535
const size_t reclaimed_per_old_gc = stats._old_stats ._stat_heap ._reclaimed_avg ;
536
536
const double current_young_bytes_freed_per_gc_time = double (reclaimed_per_young_gc) / double (young_gc_time);
537
537
const double current_old_bytes_freed_per_gc_time = double (reclaimed_per_old_gc) / double (old_gc_time);
538
+
539
+ if (current_young_bytes_freed_per_gc_time == 0.0 ) {
540
+ if (current_old_bytes_freed_per_gc_time == 0.0 ) {
541
+ // Neither young nor old collections have reclaimed any memory.
542
+ // Give them equal priority.
543
+ return 1.0 ;
544
+ }
545
+
546
+ // Only old collections have reclaimed memory.
547
+ // Prioritize old.
548
+ return ZOldGCThreads;
549
+ }
550
+
538
551
const double old_vs_young_efficiency_ratio = current_old_bytes_freed_per_gc_time / current_young_bytes_freed_per_gc_time;
539
552
540
553
return old_vs_young_efficiency_ratio;
You can’t perform that action at this time.
0 commit comments