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