changeset 56709:c203d10291e1

8231940: ZGC: Print correct low/high capacity Reviewed-by: eosterlund
author pliden
date Mon, 21 Oct 2019 09:55:48 +0200
parents 215308c0d5e8
children 8b16701b4636
files src/hotspot/share/gc/z/zStat.cpp src/hotspot/share/gc/z/zStat.hpp
diffstat 2 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/z/zStat.cpp	Mon Oct 21 09:55:31 2019 +0200
+++ b/src/hotspot/share/gc/z/zStat.cpp	Mon Oct 21 09:55:48 2019 +0200
@@ -1223,6 +1223,20 @@
 ZStatHeap::ZAtRelocateStart ZStatHeap::_at_relocate_start;
 ZStatHeap::ZAtRelocateEnd ZStatHeap::_at_relocate_end;
 
+size_t ZStatHeap::capacity_high() {
+  return MAX4(_at_mark_start.capacity,
+              _at_mark_end.capacity,
+              _at_relocate_start.capacity,
+              _at_relocate_end.capacity);
+}
+
+size_t ZStatHeap::capacity_low() {
+  return MIN4(_at_mark_start.capacity,
+              _at_mark_end.capacity,
+              _at_relocate_start.capacity,
+              _at_relocate_end.capacity);
+}
+
 size_t ZStatHeap::available(size_t used) {
   return _at_initialize.max_capacity - used;
 }
@@ -1290,8 +1304,8 @@
                                     size_t used_high,
                                     size_t used_low) {
   _at_relocate_end.capacity = capacity;
-  _at_relocate_end.capacity_high = capacity;
-  _at_relocate_end.capacity_low = _at_mark_start.capacity;
+  _at_relocate_end.capacity_high = capacity_high();
+  _at_relocate_end.capacity_low = capacity_low();
   _at_relocate_end.reserve = reserve(used);
   _at_relocate_end.reserve_high = reserve(used_low);
   _at_relocate_end.reserve_low = reserve(used_high);
--- a/src/hotspot/share/gc/z/zStat.hpp	Mon Oct 21 09:55:31 2019 +0200
+++ b/src/hotspot/share/gc/z/zStat.hpp	Mon Oct 21 09:55:48 2019 +0200
@@ -521,6 +521,8 @@
     size_t free_low;
   } _at_relocate_end;
 
+  static size_t capacity_high();
+  static size_t capacity_low();
   static size_t available(size_t used);
   static size_t reserve(size_t used);
   static size_t free(size_t used);