Skip to content

Commit fe23068

Browse files
author
Thomas Schatzl
committed
8331392: G1: Make HRPrinter distinguish between different types of reclamation
Reviewed-by: ayang, iwalulya, gli
1 parent 33243d4 commit fe23068

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

src/hotspot/share/gc/g1/g1ConcurrentMark.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ class G1UpdateRegionLivenessAndSelectForRebuildTask : public WorkerTask {
13171317
if (!_cleanup_list.is_empty()) {
13181318
log_debug(gc)("Reclaimed %u empty regions", _cleanup_list.length());
13191319
// Now print the empty regions list.
1320-
_g1h->hr_printer()->cleanup(&_cleanup_list);
1320+
_g1h->hr_printer()->mark_reclaim(&_cleanup_list);
13211321
// And actually make them available.
13221322
_g1h->prepend_to_freelist(&_cleanup_list);
13231323
}

src/hotspot/share/gc/g1/g1HRPrinter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
#include "gc/g1/g1HeapRegionSet.hpp"
2828
#include "gc/g1/g1HRPrinter.hpp"
2929

30-
void G1HRPrinter::cleanup(FreeRegionList* cleanup_list) {
30+
void G1HRPrinter::mark_reclaim(FreeRegionList* cleanup_list) {
3131
if (is_active()) {
3232
FreeRegionListIterator iter(cleanup_list);
3333
while (iter.more_available()) {
3434
HeapRegion* hr = iter.get_next();
35-
cleanup(hr);
35+
mark_reclaim(hr);
3636
}
3737
}
3838
}

src/hotspot/share/gc/g1/g1HRPrinter.hpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ class G1HRPrinter {
4040
action, hr->get_type_str(), p2i(hr->bottom()), p2i(hr->top()), p2i(hr->end()));
4141
}
4242

43+
void mark_reclaim(HeapRegion* hr) {
44+
print("MARK-RECLAIM", hr);
45+
}
46+
4347
public:
4448
// In some places we iterate over a list in order to generate output
4549
// for the list's elements. By exposing this we can avoid this
@@ -78,13 +82,19 @@ class G1HRPrinter {
7882
}
7983
}
8084

81-
void cleanup(HeapRegion* hr) {
85+
void mark_reclaim(FreeRegionList* free_list);
86+
87+
void eager_reclaim(HeapRegion* hr) {
8288
if (is_active()) {
83-
print("CLEANUP", hr);
89+
print("EAGER-RECLAIM", hr);
8490
}
8591
}
8692

87-
void cleanup(FreeRegionList* free_list);
93+
void evac_reclaim(HeapRegion* hr) {
94+
if (is_active()) {
95+
print("EVAC-RECLAIM", hr);
96+
}
97+
}
8898

8999
void post_compaction(HeapRegion* hr) {
90100
if (is_active()) {

src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionIndexClosure {
412412
r->set_containing_set(nullptr);
413413
_humongous_regions_reclaimed++;
414414
_g1h->free_humongous_region(r, nullptr);
415-
_g1h->hr_printer()->cleanup(r);
415+
_g1h->hr_printer()->eager_reclaim(r);
416416
};
417417

418418
_g1h->humongous_obj_regions_iterate(r, free_humongous_region);
@@ -760,7 +760,7 @@ class FreeCSetClosure : public HeapRegionClosure {
760760

761761
// Free the region and its remembered set.
762762
_g1h->free_region(r, nullptr);
763-
_g1h->hr_printer()->cleanup(r);
763+
_g1h->hr_printer()->evac_reclaim(r);
764764
}
765765

766766
void handle_failed_region(HeapRegion* r) {

0 commit comments

Comments
 (0)