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