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))