72 void log_heap(CollectedHeap* heap, bool before);
73
74 public:
75 GCHeapLog() : EventLogBase<GCMessage>("GC Heap History") {}
76
77 void log_heap_before(CollectedHeap* heap) {
78 log_heap(heap, true);
79 }
80 void log_heap_after(CollectedHeap* heap) {
81 log_heap(heap, false);
82 }
83 };
84
85 //
86 // CollectedHeap
87 // GenCollectedHeap
88 // SerialHeap
89 // CMSHeap
90 // G1CollectedHeap
91 // ParallelScavengeHeap
92 // ZCollectedHeap
93 //
94 class CollectedHeap : public CHeapObj<mtInternal> {
95 friend class VMStructs;
96 friend class JVMCIVMStructs;
97 friend class IsGCActiveMark; // Block structured external access to _is_gc_active
98 friend class MemAllocator;
99
100 private:
101 #ifdef ASSERT
102 static int _fire_out_of_memory_count;
103 #endif
104
105 GCHeapLog* _gc_heap_log;
106
107 MemRegion _reserved;
108
109 protected:
110 bool _is_gc_active;
111
161 static inline void fill_with_array(HeapWord* start, size_t words, bool zap = true);
162
163 // Fill with a single object (either an int array or a java.lang.Object).
164 static inline void fill_with_object_impl(HeapWord* start, size_t words, bool zap = true);
165
166 virtual void trace_heap(GCWhen::Type when, const GCTracer* tracer);
167
168 // Verification functions
169 virtual void check_for_non_bad_heap_word_value(HeapWord* addr, size_t size)
170 PRODUCT_RETURN;
171 debug_only(static void check_for_valid_allocation_state();)
172
173 public:
174 enum Name {
175 None,
176 Serial,
177 Parallel,
178 CMS,
179 G1,
180 Epsilon,
181 Z
182 };
183
184 static inline size_t filler_array_max_size() {
185 return _filler_array_max_size;
186 }
187
188 virtual Name kind() const = 0;
189
190 virtual const char* name() const = 0;
191
192 /**
193 * Returns JNI error code JNI_ENOMEM if memory could not be allocated,
194 * and JNI_OK on success.
195 */
196 virtual jint initialize() = 0;
197
198 // In many heaps, there will be a need to perform some initialization activities
199 // after the Universe is fully formed, but before general heap allocation is allowed.
200 // This is the correct place to place such initialization methods.
201 virtual void post_initialize();
|
72 void log_heap(CollectedHeap* heap, bool before);
73
74 public:
75 GCHeapLog() : EventLogBase<GCMessage>("GC Heap History") {}
76
77 void log_heap_before(CollectedHeap* heap) {
78 log_heap(heap, true);
79 }
80 void log_heap_after(CollectedHeap* heap) {
81 log_heap(heap, false);
82 }
83 };
84
85 //
86 // CollectedHeap
87 // GenCollectedHeap
88 // SerialHeap
89 // CMSHeap
90 // G1CollectedHeap
91 // ParallelScavengeHeap
92 // ShenandoahHeap
93 // ZCollectedHeap
94 //
95 class CollectedHeap : public CHeapObj<mtInternal> {
96 friend class VMStructs;
97 friend class JVMCIVMStructs;
98 friend class IsGCActiveMark; // Block structured external access to _is_gc_active
99 friend class MemAllocator;
100
101 private:
102 #ifdef ASSERT
103 static int _fire_out_of_memory_count;
104 #endif
105
106 GCHeapLog* _gc_heap_log;
107
108 MemRegion _reserved;
109
110 protected:
111 bool _is_gc_active;
112
162 static inline void fill_with_array(HeapWord* start, size_t words, bool zap = true);
163
164 // Fill with a single object (either an int array or a java.lang.Object).
165 static inline void fill_with_object_impl(HeapWord* start, size_t words, bool zap = true);
166
167 virtual void trace_heap(GCWhen::Type when, const GCTracer* tracer);
168
169 // Verification functions
170 virtual void check_for_non_bad_heap_word_value(HeapWord* addr, size_t size)
171 PRODUCT_RETURN;
172 debug_only(static void check_for_valid_allocation_state();)
173
174 public:
175 enum Name {
176 None,
177 Serial,
178 Parallel,
179 CMS,
180 G1,
181 Epsilon,
182 Z,
183 Shenandoah
184 };
185
186 static inline size_t filler_array_max_size() {
187 return _filler_array_max_size;
188 }
189
190 virtual Name kind() const = 0;
191
192 virtual const char* name() const = 0;
193
194 /**
195 * Returns JNI error code JNI_ENOMEM if memory could not be allocated,
196 * and JNI_OK on success.
197 */
198 virtual jint initialize() = 0;
199
200 // In many heaps, there will be a need to perform some initialization activities
201 // after the Universe is fully formed, but before general heap allocation is allowed.
202 // This is the correct place to place such initialization methods.
203 virtual void post_initialize();
|