File tree Expand file tree Collapse file tree 3 files changed +17
-24
lines changed Expand file tree Collapse file tree 3 files changed +17
-24
lines changed Original file line number Diff line number Diff line change 3636#include " gc/shared/gcWhen.hpp"
3737#include " gc/shared/memAllocator.hpp"
3838#include " logging/log.hpp"
39+ #include " logging/logStream.hpp"
3940#include " memory/metaspace.hpp"
4041#include " memory/resourceArea.hpp"
4142#include " memory/universe.hpp"
@@ -123,14 +124,28 @@ MetaspaceSummary CollectedHeap::create_metaspace_summary() {
123124}
124125
125126void CollectedHeap::print_heap_before_gc () {
126- Universe::print_heap_before_gc ();
127+ LogTarget (Debug, gc, heap) lt;
128+ if (lt.is_enabled ()) {
129+ LogStream ls (lt);
130+ ls.print_cr (" Heap before GC invocations=%u (full %u):" , total_collections (), total_full_collections ());
131+ ResourceMark rm;
132+ print_on (&ls);
133+ }
134+
127135 if (_gc_heap_log != NULL ) {
128136 _gc_heap_log->log_heap_before (this );
129137 }
130138}
131139
132140void CollectedHeap::print_heap_after_gc () {
133- Universe::print_heap_after_gc ();
141+ LogTarget (Debug, gc, heap) lt;
142+ if (lt.is_enabled ()) {
143+ LogStream ls (lt);
144+ ls.print_cr (" Heap after GC invocations=%u (full %u):" , total_collections (), total_full_collections ());
145+ ResourceMark rm;
146+ print_on (&ls);
147+ }
148+
134149 if (_gc_heap_log != NULL ) {
135150 _gc_heap_log->log_heap_after (this );
136151 }
Original file line number Diff line number Diff line change @@ -1031,26 +1031,6 @@ void Universe::print_heap_at_SIGBREAK() {
10311031 }
10321032}
10331033
1034- void Universe::print_heap_before_gc () {
1035- LogTarget (Debug, gc, heap) lt;
1036- if (lt.is_enabled ()) {
1037- LogStream ls (lt);
1038- ls.print (" Heap before GC invocations=%u (full %u):" , heap ()->total_collections (), heap ()->total_full_collections ());
1039- ResourceMark rm;
1040- heap ()->print_on (&ls);
1041- }
1042- }
1043-
1044- void Universe::print_heap_after_gc () {
1045- LogTarget (Debug, gc, heap) lt;
1046- if (lt.is_enabled ()) {
1047- LogStream ls (lt);
1048- ls.print (" Heap after GC invocations=%u (full %u):" , heap ()->total_collections (), heap ()->total_full_collections ());
1049- ResourceMark rm;
1050- heap ()->print_on (&ls);
1051- }
1052- }
1053-
10541034void Universe::initialize_verify_flags () {
10551035 verify_flags = 0 ;
10561036 const char delimiter[] = " ," ;
Original file line number Diff line number Diff line change @@ -357,8 +357,6 @@ class Universe: AllStatic {
357357 static int verify_count () { return _verify_count; }
358358 static void print_on (outputStream* st);
359359 static void print_heap_at_SIGBREAK ();
360- static void print_heap_before_gc ();
361- static void print_heap_after_gc ();
362360
363361 // Change the number of dummy objects kept reachable by the full gc dummy
364362 // array; this should trigger relocation in a sliding compaction collector.
You can’t perform that action at this time.
0 commit comments