--- old/src/hotspot/share/gc/z/zVirtualMemory.cpp 2020-08-28 12:23:56.121695286 +0200 +++ new/src/hotspot/share/gc/z/zVirtualMemory.cpp 2020-08-28 12:23:56.005694779 +0200 @@ -24,6 +24,7 @@ #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" @@ -43,8 +44,14 @@ // Reserve address space if (!reserve(max_capacity)) { - log_error_pd(gc)("Failed to reserve enough address space for Java heap"); - return; + // 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