Skip to content

Commit 263d070

Browse files
committed
8260571: Add PrintMetaspaceStatistics to print metaspace statistics upon VM exit
Reviewed-by: clanger Backport-of: ddd2951
1 parent e9aaba4 commit 263d070

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/hotspot/share/runtime/globals.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,6 +1824,9 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
18241824
"class pointers are used") \
18251825
range(1*M, 3*G) \
18261826
\
1827+
diagnostic(bool, PrintMetaspaceStatisticsAtExit, false, \
1828+
"Print metaspace statistics upon VM exit.") \
1829+
\
18271830
manageable(uintx, MinHeapFreeRatio, 40, \
18281831
"The minimum percentage of heap free after GC to avoid expansion."\
18291832
" For most GCs this applies to the old generation. In G1 and" \

src/hotspot/share/runtime/java.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,10 @@ void print_statistics() {
380380
MemTracker::final_report(tty);
381381
}
382382

383+
if (PrintMetaspaceStatisticsAtExit) {
384+
MetaspaceUtils::print_basic_report(tty, 0);
385+
}
386+
383387
ThreadsSMRSupport::log_statistics();
384388
}
385389

@@ -423,6 +427,10 @@ void print_statistics() {
423427
MemTracker::final_report(tty);
424428
}
425429

430+
if (PrintMetaspaceStatisticsAtExit) {
431+
MetaspaceUtils::print_basic_report(tty, 0);
432+
}
433+
426434
if (LogTouchedMethods && PrintTouchedMethodsAtExit) {
427435
Method::print_touched_methods(tty);
428436
}

0 commit comments

Comments
 (0)