src/hotspot/share/gc/z/zVirtualMemory.cpp
changeset 58468 97cd0aa39787
parent 58287 a7f16447085e
child 58679 9c3209ff7550
child 58787 32d39d9525f9
--- a/src/hotspot/share/gc/z/zVirtualMemory.cpp	Sun Oct 06 13:08:58 2019 -0400
+++ b/src/hotspot/share/gc/z/zVirtualMemory.cpp	Mon Oct 07 07:53:38 2019 +0200
@@ -31,6 +31,13 @@
     _manager(),
     _initialized(false) {
 
+  // Check max supported heap size
+  if (max_capacity > ZAddressOffsetMax) {
+    log_error(gc)("Java heap too large (max supported heap size is " SIZE_FORMAT "G)",
+                  ZAddressOffsetMax / G);
+    return;
+  }
+
   log_info(gc, init)("Address Space: " SIZE_FORMAT "T", ZAddressOffsetMax / K / G);
 
   // Reserve address space