changeset 59531:50fe8727ed79

8246045: ZGC: Fix ZDirector::rule_high_usage() calculation Reviewed-by: stefank, eosterlund
author pliden
date Sun, 31 May 2020 23:15:30 +0200
parents c15e3098fb2a
children 041690501b8e
files src/hotspot/share/gc/z/zDirector.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/z/zDirector.cpp	Sun May 31 23:15:07 2020 +0200
+++ b/src/hotspot/share/gc/z/zDirector.cpp	Sun May 31 23:15:30 2020 +0200
@@ -186,7 +186,7 @@
   const size_t soft_max_capacity = ZHeap::heap()->soft_max_capacity();
   const size_t max_reserve = ZHeap::heap()->max_reserve();
   const size_t used = ZHeap::heap()->used();
-  const size_t free_with_reserve = soft_max_capacity - used;
+  const size_t free_with_reserve = soft_max_capacity - MIN2(soft_max_capacity, used);
   const size_t free = free_with_reserve - MIN2(free_with_reserve, max_reserve);
   const double free_percent = percent_of(free, soft_max_capacity);