diff --git a/src/hotspot/share/gc/shared/gcConfig.cpp b/src/hotspot/share/gc/shared/gcConfig.cpp index 402bd0caacddc..c31bce353541d 100644 --- a/src/hotspot/share/gc/shared/gcConfig.cpp +++ b/src/hotspot/share/gc/shared/gcConfig.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,10 +95,11 @@ void GCConfig::fail_if_non_included_gc_is_selected() { } void GCConfig::select_gc_ergonomically() { - if (os::is_server_class_machine()) { #if INCLUDE_G1GC - FLAG_SET_ERGO_IF_DEFAULT(UseG1GC, true); -#elif INCLUDE_PARALLELGC + FLAG_SET_ERGO_IF_DEFAULT(UseG1GC, true); +#else + if (os::is_server_class_machine()) { +#if INCLUDE_PARALLELGC FLAG_SET_ERGO_IF_DEFAULT(UseParallelGC, true); #elif INCLUDE_SERIALGC FLAG_SET_ERGO_IF_DEFAULT(UseSerialGC, true); @@ -108,6 +109,7 @@ void GCConfig::select_gc_ergonomically() { FLAG_SET_ERGO_IF_DEFAULT(UseSerialGC, true); #endif } +#endif } bool GCConfig::is_no_gc_selected() {