--- old/src/hotspot/os/windows/os_windows.cpp 2020-04-29 08:22:49.444183129 -0400 +++ new/src/hotspot/os/windows/os_windows.cpp 2020-04-29 08:22:49.136173198 -0400 @@ -4096,10 +4096,17 @@ UseNUMA = false; // We don't fully support this yet } - if (UseNUMAInterleaving) { - // first check whether this Windows OS supports VirtualAllocExNuma, if not ignore this flag - bool success = numa_interleaving_init(); - if (!success) UseNUMAInterleaving = false; + // If UseNUMA then UseNUMAInterleaving is later (Arguments) defaulted to + // true, but that's too late to call numa_interleaving_init. + if (UseNUMAInterleaving || (UseNUMA && FLAG_IS_DEFAULT(UseNUMAInterleaving))) { + // Check whether this Windows OS provides the needed support. + if (!numa_interleaving_init()) { + // Not supported, so disable flag and prevent later defaulted change. + FLAG_SET_ERGO(UseNUMAInterleaving, false); + } else if (!UseNUMAInterleaving) { + // Supported, so change flag now, rather than waiting for Arguments. + FLAG_SET_ERGO(UseNUMAInterleaving, true); + } } if (initSock() != JNI_OK) {