203 CMSHeap
204 };
205
206 static inline size_t filler_array_max_size() {
207 return _filler_array_max_size;
208 }
209
210 virtual Name kind() const = 0;
211
212 virtual const char* name() const = 0;
213
214 /**
215 * Returns JNI error code JNI_ENOMEM if memory could not be allocated,
216 * and JNI_OK on success.
217 */
218 virtual jint initialize() = 0;
219
220 // In many heaps, there will be a need to perform some initialization activities
221 // after the Universe is fully formed, but before general heap allocation is allowed.
222 // This is the correct place to place such initialization methods.
223 virtual void post_initialize() = 0;
224
225 // Stop any onging concurrent work and prepare for exit.
226 virtual void stop() {}
227
228 // Stop and resume concurrent GC threads interfering with safepoint operations
229 virtual void safepoint_synchronize_begin() {}
230 virtual void safepoint_synchronize_end() {}
231
232 void initialize_reserved_region(HeapWord *start, HeapWord *end);
233 MemRegion reserved_region() const { return _reserved; }
234 address base() const { return (address)reserved_region().start(); }
235
236 virtual size_t capacity() const = 0;
237 virtual size_t used() const = 0;
238
239 // Return "true" if the part of the heap that allocates Java
240 // objects has reached the maximal committed limit that it can
241 // reach, without a garbage collection.
242 virtual bool is_maximal_no_gc() const = 0;
243
518
519 // Requires "addr" to be the start of a chunk, and returns its size.
520 // "addr + size" is required to be the start of a new chunk, or the end
521 // of the active area of the heap.
522 virtual size_t block_size(const HeapWord* addr) const = 0;
523
524 // Requires "addr" to be the start of a block, and returns "TRUE" iff
525 // the block is an object.
526 virtual bool block_is_obj(const HeapWord* addr) const = 0;
527
528 // Returns the longest time (in ms) that has elapsed since the last
529 // time that any part of the heap was examined by a garbage collection.
530 virtual jlong millis_since_last_gc() = 0;
531
532 // Perform any cleanup actions necessary before allowing a verification.
533 virtual void prepare_for_verify() = 0;
534
535 // Generate any dumps preceding or following a full gc
536 private:
537 void full_gc_dump(GCTimer* timer, bool before);
538 public:
539 void pre_full_gc_dump(GCTimer* timer);
540 void post_full_gc_dump(GCTimer* timer);
541
542 VirtualSpaceSummary create_heap_space_summary();
543 GCHeapSummary create_heap_summary();
544
545 MetaspaceSummary create_metaspace_summary();
546
547 // Print heap information on the given outputStream.
548 virtual void print_on(outputStream* st) const = 0;
549 // The default behavior is to call print_on() on tty.
550 virtual void print() const {
551 print_on(tty);
552 }
553 // Print more detailed heap information on the given
554 // outputStream. The default behavior is to call print_on(). It is
555 // up to each subclass to override it and add any additional output
556 // it needs.
557 virtual void print_extended_on(outputStream* st) const {
|
203 CMSHeap
204 };
205
206 static inline size_t filler_array_max_size() {
207 return _filler_array_max_size;
208 }
209
210 virtual Name kind() const = 0;
211
212 virtual const char* name() const = 0;
213
214 /**
215 * Returns JNI error code JNI_ENOMEM if memory could not be allocated,
216 * and JNI_OK on success.
217 */
218 virtual jint initialize() = 0;
219
220 // In many heaps, there will be a need to perform some initialization activities
221 // after the Universe is fully formed, but before general heap allocation is allowed.
222 // This is the correct place to place such initialization methods.
223 virtual void post_initialize();
224
225 // Stop any onging concurrent work and prepare for exit.
226 virtual void stop() {}
227
228 // Stop and resume concurrent GC threads interfering with safepoint operations
229 virtual void safepoint_synchronize_begin() {}
230 virtual void safepoint_synchronize_end() {}
231
232 void initialize_reserved_region(HeapWord *start, HeapWord *end);
233 MemRegion reserved_region() const { return _reserved; }
234 address base() const { return (address)reserved_region().start(); }
235
236 virtual size_t capacity() const = 0;
237 virtual size_t used() const = 0;
238
239 // Return "true" if the part of the heap that allocates Java
240 // objects has reached the maximal committed limit that it can
241 // reach, without a garbage collection.
242 virtual bool is_maximal_no_gc() const = 0;
243
518
519 // Requires "addr" to be the start of a chunk, and returns its size.
520 // "addr + size" is required to be the start of a new chunk, or the end
521 // of the active area of the heap.
522 virtual size_t block_size(const HeapWord* addr) const = 0;
523
524 // Requires "addr" to be the start of a block, and returns "TRUE" iff
525 // the block is an object.
526 virtual bool block_is_obj(const HeapWord* addr) const = 0;
527
528 // Returns the longest time (in ms) that has elapsed since the last
529 // time that any part of the heap was examined by a garbage collection.
530 virtual jlong millis_since_last_gc() = 0;
531
532 // Perform any cleanup actions necessary before allowing a verification.
533 virtual void prepare_for_verify() = 0;
534
535 // Generate any dumps preceding or following a full gc
536 private:
537 void full_gc_dump(GCTimer* timer, bool before);
538
539 virtual void initialize_serviceability() = 0;
540
541 public:
542 void pre_full_gc_dump(GCTimer* timer);
543 void post_full_gc_dump(GCTimer* timer);
544
545 VirtualSpaceSummary create_heap_space_summary();
546 GCHeapSummary create_heap_summary();
547
548 MetaspaceSummary create_metaspace_summary();
549
550 // Print heap information on the given outputStream.
551 virtual void print_on(outputStream* st) const = 0;
552 // The default behavior is to call print_on() on tty.
553 virtual void print() const {
554 print_on(tty);
555 }
556 // Print more detailed heap information on the given
557 // outputStream. The default behavior is to call print_on(). It is
558 // up to each subclass to override it and add any additional output
559 // it needs.
560 virtual void print_extended_on(outputStream* st) const {
|