@@ -2057,16 +2057,6 @@ bool G1CollectedHeap::supports_concurrent_gc_breakpoints() const {
2057
2057
return true ;
2058
2058
}
2059
2059
2060
- class PrintRegionClosure : public HeapRegionClosure {
2061
- outputStream* _st;
2062
- public:
2063
- PrintRegionClosure (outputStream* st) : _st(st) {}
2064
- bool do_heap_region (HeapRegion* r) {
2065
- r->print_on (_st);
2066
- return false ;
2067
- }
2068
- };
2069
-
2070
2060
bool G1CollectedHeap::is_obj_dead_cond (const oop obj,
2071
2061
const HeapRegion* hr,
2072
2062
const VerifyOption vo) const {
@@ -2088,11 +2078,11 @@ bool G1CollectedHeap::is_obj_dead_cond(const oop obj,
2088
2078
return false ; // keep some compilers happy
2089
2079
}
2090
2080
2091
- void G1CollectedHeap::print_heap_regions () const {
2081
+ void G1CollectedHeap::print_heap_regions (bool print_pin_counts ) const {
2092
2082
LogTarget (Trace, gc, heap, region) lt;
2093
2083
if (lt.is_enabled ()) {
2094
2084
LogStream ls (lt);
2095
- print_regions_on (&ls);
2085
+ print_regions_on (&ls, print_pin_counts );
2096
2086
}
2097
2087
}
2098
2088
@@ -2126,13 +2116,25 @@ void G1CollectedHeap::print_on(outputStream* st) const {
2126
2116
MetaspaceUtils::print_on (st);
2127
2117
}
2128
2118
2129
- void G1CollectedHeap::print_regions_on (outputStream* st) const {
2119
+
2120
+ class PrintRegionClosure : public HeapRegionClosure {
2121
+ outputStream* _st;
2122
+ const bool _print_pin_counts;
2123
+ public:
2124
+ PrintRegionClosure (outputStream* st, bool print_pin_counts) : _st(st), _print_pin_counts(print_pin_counts) {}
2125
+ bool do_heap_region (HeapRegion* r) {
2126
+ r->print_on (_st, _print_pin_counts);
2127
+ return false ;
2128
+ }
2129
+ };
2130
+
2131
+ void G1CollectedHeap::print_regions_on (outputStream* st, bool print_pin_counts) const {
2130
2132
st->print_cr (" Heap Regions: E=young(eden), S=young(survivor), O=old, "
2131
2133
" HS=humongous(starts), HC=humongous(continues), "
2132
2134
" CS=collection set, F=free, "
2133
2135
" TAMS=top-at-mark-start, "
2134
2136
" PB=parsable bottom" );
2135
- PrintRegionClosure blk (st);
2137
+ PrintRegionClosure blk (st, print_pin_counts );
2136
2138
heap_region_iterate (&blk);
2137
2139
}
2138
2140
@@ -2141,7 +2143,7 @@ void G1CollectedHeap::print_extended_on(outputStream* st) const {
2141
2143
2142
2144
// Print the per-region information.
2143
2145
st->cr ();
2144
- print_regions_on (st);
2146
+ print_regions_on (st, true /* print_pin_counts */ );
2145
2147
}
2146
2148
2147
2149
void G1CollectedHeap::print_on_error (outputStream* st) const {
@@ -2422,7 +2424,8 @@ G1HeapPrinterMark::G1HeapPrinterMark(G1CollectedHeap* g1h) : _g1h(g1h), _heap_tr
2422
2424
_g1h->total_collections (),
2423
2425
true /* show_thread_times */ );
2424
2426
_g1h->print_heap_before_gc ();
2425
- _g1h->print_heap_regions ();
2427
+ // We did not merge in the cached pin counts yet, making the output confusing.
2428
+ _g1h->print_heap_regions (false /* print_pin_counts */ );
2426
2429
}
2427
2430
2428
2431
G1HeapPrinterMark::~G1HeapPrinterMark () {
@@ -2434,7 +2437,7 @@ G1HeapPrinterMark::~G1HeapPrinterMark() {
2434
2437
false /* show_thread_times */ );
2435
2438
2436
2439
_heap_transition.print ();
2437
- _g1h->print_heap_regions ();
2440
+ _g1h->print_heap_regions (true /* print_pin_counts */ );
2438
2441
_g1h->print_heap_after_gc ();
2439
2442
// Print NUMA statistics.
2440
2443
_g1h->numa ()->print_statistics ();
0 commit comments