This repository was archived by the owner on Aug 27, 2022. It is now read-only.
File tree 3 files changed +17
-24
lines changed
3 files changed +17
-24
lines changed Original file line number Diff line number Diff line change 36
36
#include " gc/shared/gcWhen.hpp"
37
37
#include " gc/shared/memAllocator.hpp"
38
38
#include " logging/log.hpp"
39
+ #include " logging/logStream.hpp"
39
40
#include " memory/metaspace.hpp"
40
41
#include " memory/resourceArea.hpp"
41
42
#include " memory/universe.hpp"
@@ -123,14 +124,28 @@ MetaspaceSummary CollectedHeap::create_metaspace_summary() {
123
124
}
124
125
125
126
void 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
+
127
135
if (_gc_heap_log != NULL ) {
128
136
_gc_heap_log->log_heap_before (this );
129
137
}
130
138
}
131
139
132
140
void 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
+
134
149
if (_gc_heap_log != NULL ) {
135
150
_gc_heap_log->log_heap_after (this );
136
151
}
Original file line number Diff line number Diff line change @@ -1031,26 +1031,6 @@ void Universe::print_heap_at_SIGBREAK() {
1031
1031
}
1032
1032
}
1033
1033
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
-
1054
1034
void Universe::initialize_verify_flags () {
1055
1035
verify_flags = 0 ;
1056
1036
const char delimiter[] = " ," ;
Original file line number Diff line number Diff line change @@ -357,8 +357,6 @@ class Universe: AllStatic {
357
357
static int verify_count () { return _verify_count; }
358
358
static void print_on (outputStream* st);
359
359
static void print_heap_at_SIGBREAK ();
360
- static void print_heap_before_gc ();
361
- static void print_heap_after_gc ();
362
360
363
361
// Change the number of dummy objects kept reachable by the full gc dummy
364
362
// array; this should trigger relocation in a sliding compaction collector.
You can’t perform that action at this time.
0 commit comments