From 53f32a1486ccf605199e4e3a293c5c9fd924d9d0 Mon Sep 17 00:00:00 2001 From: Lutz Schmidt Date: Thu, 20 Jun 2024 17:42:24 +0200 Subject: [PATCH 1/2] VM startup: fatal error: FLAG_SET_ERGO cannot be used to set an invalid value for NonNMethodCodeHeapSize --- src/hotspot/share/code/codeCache.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp index 20583ce492ddd..1e6213fa909eb 100644 --- a/src/hotspot/share/code/codeCache.cpp +++ b/src/hotspot/share/code/codeCache.cpp @@ -227,6 +227,11 @@ void CodeCache::initialize_heaps() { if (!non_nmethod.set) { non_nmethod.size += compiler_buffer_size; + // Further down, just before FLAG_SET_ERGO(), all segment sizes are + // aligned down to the next lower multiple of min_size. For large page + // sizes, this may result in (non_nmethod.size == 0) which is not acceptable. + // Therefore, force non_nmethod.size to at least min_size. + non_nmethod.size = MAX2(non_nmethod.size, min_size); } if (!profiled.set && !non_profiled.set) { From 585db1b79b2f7a1417df0a408511d7fab1cbc8a4 Mon Sep 17 00:00:00 2001 From: Lutz Schmidt Date: Thu, 20 Jun 2024 18:50:15 +0200 Subject: [PATCH 2/2] 8334564: Remove extra whitespace. --- src/hotspot/share/code/codeCache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp index 1e6213fa909eb..36656515942c3 100644 --- a/src/hotspot/share/code/codeCache.cpp +++ b/src/hotspot/share/code/codeCache.cpp @@ -231,7 +231,7 @@ void CodeCache::initialize_heaps() { // aligned down to the next lower multiple of min_size. For large page // sizes, this may result in (non_nmethod.size == 0) which is not acceptable. // Therefore, force non_nmethod.size to at least min_size. - non_nmethod.size = MAX2(non_nmethod.size, min_size); + non_nmethod.size = MAX2(non_nmethod.size, min_size); } if (!profiled.set && !non_profiled.set) {