< prev index next >

src/hotspot/share/gc/z/zVirtualMemory.cpp

Print this page

        

@@ -22,10 +22,11 @@
  */
 
 #include "precompiled.hpp"
 #include "gc/shared/gcLogPrecious.hpp"
 #include "gc/z/zAddressSpaceLimit.hpp"
+#include "gc/z/zAddress.hpp"
 #include "gc/z/zGlobals.hpp"
 #include "gc/z/zVirtualMemory.inline.hpp"
 #include "services/memTracker.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/align.hpp"

@@ -41,13 +42,19 @@
     return;
   }
 
   // Reserve address space
   if (!reserve(max_capacity)) {
+    // try to reserve with a reduced number of address bits
+    log_info_p(gc, init)("Re-configuring ZAddressBits to " SIZE_FORMAT ", allocation with " SIZE_FORMAT " failed", _address_bits_seen, ZAddressBits);
+    ZAddressBits = _address_bits_seen;
+    ZAddress::initialize();
+    if (!reserve(max_capacity)) {
     log_error_pd(gc)("Failed to reserve enough address space for Java heap");
     return;
   }
+  }
 
   // Initialize OS specific parts
   initialize_os();
 
   // Successfully initialized
< prev index next >