From 0cc0f063e2c19bdc1cd31a8656e330a333419f37 Mon Sep 17 00:00:00 2001 From: Ivan Walulya Date: Tue, 14 Mar 2023 10:46:16 +0000 Subject: [PATCH] 8304015: G1: Metaspace-induced GCs should not trigger maximal compaction Reviewed-by: ayang, tschatzl --- src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index e55794209b9..d8f6c68a51e 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -1065,12 +1065,10 @@ void G1CollectedHeap::do_full_collection(bool clear_all_soft_refs) { // Currently, there is no facility in the do_full_collection(bool) API to notify // the caller that the collection did not succeed (e.g., because it was locked // out by the GC locker). So, right now, we'll ignore the return value. - // When clear_all_soft_refs is set we want to do a maximal compaction - // not leaving any dead wood. - bool do_maximal_compaction = clear_all_soft_refs; - bool dummy = do_full_collection(true, /* explicit_gc */ - clear_all_soft_refs, - do_maximal_compaction); + + do_full_collection(false, /* explicit_gc */ + clear_all_soft_refs, + false /* do_maximal_compaction */); } bool G1CollectedHeap::upgrade_to_full_collection() {