--- 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);