src/hotspot/share/gc/z/zPageAllocator.cpp
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54834 39ba09047e19
child 58679 9c3209ff7550
--- a/src/hotspot/share/gc/z/zPageAllocator.cpp	Thu Oct 17 20:27:44 2019 +0100
+++ b/src/hotspot/share/gc/z/zPageAllocator.cpp	Thu Oct 17 20:53:35 2019 +0100
@@ -34,6 +34,7 @@
 #include "gc/z/zSafeDelete.inline.hpp"
 #include "gc/z/zStat.hpp"
 #include "gc/z/zTracer.inline.hpp"
+#include "runtime/globals.hpp"
 #include "runtime/init.hpp"
 #include "runtime/java.hpp"
 #include "utilities/debug.hpp"
@@ -93,7 +94,7 @@
                                size_t max_capacity,
                                size_t max_reserve) :
     _lock(),
-    _virtual(),
+    _virtual(max_capacity),
     _physical(),
     _cache(),
     _min_capacity(min_capacity),
@@ -181,8 +182,9 @@
   return _max_capacity;
 }
 
-size_t ZPageAllocator::current_max_capacity() const {
-  return _current_max_capacity;
+size_t ZPageAllocator::soft_max_capacity() const {
+  // Note that SoftMaxHeapSize is a manageable flag
+  return MIN2(SoftMaxHeapSize, _current_max_capacity);
 }
 
 size_t ZPageAllocator::capacity() const {
@@ -335,7 +337,7 @@
       // Failed, or partly failed, to increase capacity. Adjust current
       // max capacity to avoid further attempts to increase capacity.
       log_error(gc)("Forced to lower max Java heap size from "
-                    SIZE_FORMAT "M(%.0lf%%) to " SIZE_FORMAT "M(%.0lf%%)",
+                    SIZE_FORMAT "M(%.0f%%) to " SIZE_FORMAT "M(%.0f%%)",
                     _current_max_capacity / M, percent_of(_current_max_capacity, _max_capacity),
                     _capacity / M, percent_of(_capacity, _max_capacity));
 
@@ -570,7 +572,7 @@
   const size_t cached_after = _cache.available();
   const size_t cached_before = cached_after + flushed;
 
-  log_info(gc, heap)("Page Cache: " SIZE_FORMAT "M(%.0lf%%)->" SIZE_FORMAT "M(%.0lf%%), "
+  log_info(gc, heap)("Page Cache: " SIZE_FORMAT "M(%.0f%%)->" SIZE_FORMAT "M(%.0f%%), "
                      "Flushed: " SIZE_FORMAT "M",
                      cached_before / M, percent_of(cached_before, max_capacity()),
                      cached_after / M, percent_of(cached_after, max_capacity()),
@@ -658,7 +660,7 @@
   }
 
   if (uncommitted > 0) {
-    log_info(gc, heap)("Capacity: " SIZE_FORMAT "M(%.0lf%%)->" SIZE_FORMAT "M(%.0lf%%), "
+    log_info(gc, heap)("Capacity: " SIZE_FORMAT "M(%.0f%%)->" SIZE_FORMAT "M(%.0f%%), "
                        "Uncommitted: " SIZE_FORMAT "M",
                        capacity_before / M, percent_of(capacity_before, max_capacity()),
                        capacity_after / M, percent_of(capacity_after, max_capacity()),