diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp index 804f255217f..e3ab84e9555 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp @@ -1247,6 +1247,7 @@ class G1UpdateRegionLivenessAndSelectForRebuildTask : public WorkerTask { hr->set_containing_set(nullptr); hr->clear_cardtable(); _g1h->concurrent_mark()->clear_statistics(hr); + G1HeapRegionPrinter::mark_reclaim(hr); _g1h->free_humongous_region(hr, _local_cleanup_list); }; @@ -1263,6 +1264,7 @@ class G1UpdateRegionLivenessAndSelectForRebuildTask : public WorkerTask { hr->set_containing_set(nullptr); hr->clear_cardtable(); _g1h->concurrent_mark()->clear_statistics(hr); + G1HeapRegionPrinter::mark_reclaim(hr); _g1h->free_region(hr, _local_cleanup_list); } @@ -1317,8 +1319,6 @@ public: ~G1UpdateRegionLivenessAndSelectForRebuildTask() { if (!_cleanup_list.is_empty()) { log_debug(gc)("Reclaimed %u empty regions", _cleanup_list.length()); - // Now print the empty regions list. - G1HeapRegionPrinter::mark_reclaim(&_cleanup_list); // And actually make them available. _g1h->prepend_to_freelist(&_cleanup_list); } diff --git a/src/hotspot/share/gc/g1/g1HeapRegionPrinter.cpp b/src/hotspot/share/gc/g1/g1HeapRegionPrinter.cpp deleted file mode 100644 index 1c87b800601..00000000000 --- a/src/hotspot/share/gc/g1/g1HeapRegionPrinter.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021, 2024, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" - -#include "gc/g1/g1HeapRegionPrinter.hpp" -#include "gc/g1/g1HeapRegionSet.hpp" - -void G1HeapRegionPrinter::mark_reclaim(FreeRegionList* cleanup_list) { - if (is_active()) { - FreeRegionListIterator iter(cleanup_list); - while (iter.more_available()) { - HeapRegion* hr = iter.get_next(); - mark_reclaim(hr); - } - } -} diff --git a/src/hotspot/share/gc/g1/g1HeapRegionPrinter.hpp b/src/hotspot/share/gc/g1/g1HeapRegionPrinter.hpp index 20a6e795da0..ed6d171fb6f 100644 --- a/src/hotspot/share/gc/g1/g1HeapRegionPrinter.hpp +++ b/src/hotspot/share/gc/g1/g1HeapRegionPrinter.hpp @@ -39,10 +39,6 @@ class G1HeapRegionPrinter : public AllStatic { action, hr->get_type_str(), p2i(hr->bottom()), p2i(hr->top()), p2i(hr->end())); } - static void mark_reclaim(HeapRegion* hr) { - print("MARK-RECLAIM", hr); - } - public: // In some places we iterate over a list in order to generate output // for the list's elements. By exposing this we can avoid this @@ -61,7 +57,7 @@ public: static void evac_failure(HeapRegion* hr) { print("EVAC-FAILURE", hr); } - static void mark_reclaim(FreeRegionList* free_list); + static void mark_reclaim(HeapRegion* hr) { print("MARK-RECLAIM", hr); } static void eager_reclaim(HeapRegion* hr) { print("EAGER-RECLAIM", hr); } diff --git a/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp b/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp index 288abc87be9..ac1a758a709 100644 --- a/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp +++ b/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp @@ -412,8 +412,8 @@ public: _freed_bytes += r->used(); r->set_containing_set(nullptr); _humongous_regions_reclaimed++; - _g1h->free_humongous_region(r, nullptr); G1HeapRegionPrinter::eager_reclaim(r); + _g1h->free_humongous_region(r, nullptr); }; _g1h->humongous_obj_regions_iterate(r, free_humongous_region); @@ -759,9 +759,9 @@ class FreeCSetClosure : public HeapRegionClosure { assert(!r->is_empty(), "Region %u is an empty region in the collection set.", r->hrm_index()); stats()->account_evacuated_region(r); + G1HeapRegionPrinter::evac_reclaim(r); // Free the region and its remembered set. _g1h->free_region(r, nullptr); - G1HeapRegionPrinter::evac_reclaim(r); } void handle_failed_region(HeapRegion* r) {