From ba0ae4cb28aa520d5244077349e35ef1bb475b61 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Tue, 5 Aug 2025 10:43:30 +0000 Subject: [PATCH] 8364254: Serial: Remove soft ref policy update in WhiteBox FullGC Reviewed-by: tschatzl, sangheki --- src/hotspot/share/prims/whitebox.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp index aaaac349ee3..be5d9d3d8a1 100644 --- a/src/hotspot/share/prims/whitebox.cpp +++ b/src/hotspot/share/prims/whitebox.cpp @@ -1502,12 +1502,12 @@ WB_END WB_ENTRY(void, WB_FullGC(JNIEnv* env, jobject o)) Universe::heap()->soft_ref_policy()->set_should_clear_all_soft_refs(true); Universe::heap()->collect(GCCause::_wb_full_gc); -#if INCLUDE_G1GC || INCLUDE_SERIALGC - if (UseG1GC || UseSerialGC) { - // Needs to be cleared explicitly for G1 and Serial GC. +#if INCLUDE_G1GC + if (UseG1GC) { + // Needs to be cleared explicitly for G1 GC. Universe::heap()->soft_ref_policy()->set_should_clear_all_soft_refs(false); } -#endif // INCLUDE_G1GC || INCLUDE_SERIALGC +#endif // INCLUDE_G1GC WB_END WB_ENTRY(void, WB_YoungGC(JNIEnv* env, jobject o))