11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_HPP
26 #define SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_HPP
27
28 #include "gc_interface/gcCause.hpp"
29 #include "gc_implementation/shared/gcWhen.hpp"
30 #include "memory/allocation.hpp"
31 #include "memory/barrierSet.hpp"
32 #include "runtime/handles.hpp"
33 #include "runtime/perfData.hpp"
34 #include "runtime/safepoint.hpp"
35 #include "utilities/events.hpp"
36
37 // A "CollectedHeap" is an implementation of a java heap for HotSpot. This
38 // is an abstract class: there may be many different kinds of heaps. This
39 // class defines the functions that a heap must implement, and contains
40 // infrastructure common to all heaps.
41
42 class AdaptiveSizePolicy;
43 class BarrierSet;
44 class CollectorPolicy;
45 class GCHeapSummary;
46 class GCTimer;
47 class GCTracer;
48 class MetaspaceSummary;
49 class Thread;
50 class ThreadClosure;
51 class VirtualSpaceSummary;
559
560 VirtualSpaceSummary create_heap_space_summary();
561 GCHeapSummary create_heap_summary();
562
563 MetaspaceSummary create_metaspace_summary();
564
565 // Print heap information on the given outputStream.
566 virtual void print_on(outputStream* st) const = 0;
567 // The default behavior is to call print_on() on tty.
568 virtual void print() const {
569 print_on(tty);
570 }
571 // Print more detailed heap information on the given
572 // outputStream. The default behavior is to call print_on(). It is
573 // up to each subclass to override it and add any additional output
574 // it needs.
575 virtual void print_extended_on(outputStream* st) const {
576 print_on(st);
577 }
578
579 virtual void print_on_error(outputStream* st) const {
580 st->print_cr("Heap:");
581 print_extended_on(st);
582 st->cr();
583
584 _barrier_set->print_on(st);
585 }
586
587 // Print all GC threads (other than the VM thread)
588 // used by this heap.
589 virtual void print_gc_threads_on(outputStream* st) const = 0;
590 // The default behavior is to call print_gc_threads_on() on tty.
591 void print_gc_threads() {
592 print_gc_threads_on(tty);
593 }
594 // Iterator for all GC threads (other than VM thread)
595 virtual void gc_threads_do(ThreadClosure* tc) const = 0;
596
597 // Print any relevant tracing info that flags imply.
598 // Default implementation does nothing.
599 virtual void print_tracing_info() const = 0;
600
601 void print_heap_before_gc();
602 void print_heap_after_gc();
603
604 // Registering and unregistering an nmethod (compiled code) with the heap.
605 // Override with specific mechanism for each specialized heap type.
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_HPP
26 #define SHARE_VM_GC_INTERFACE_COLLECTEDHEAP_HPP
27
28 #include "gc_interface/gcCause.hpp"
29 #include "gc_implementation/shared/gcWhen.hpp"
30 #include "memory/allocation.hpp"
31 #include "runtime/handles.hpp"
32 #include "runtime/perfData.hpp"
33 #include "runtime/safepoint.hpp"
34 #include "utilities/events.hpp"
35
36 // A "CollectedHeap" is an implementation of a java heap for HotSpot. This
37 // is an abstract class: there may be many different kinds of heaps. This
38 // class defines the functions that a heap must implement, and contains
39 // infrastructure common to all heaps.
40
41 class AdaptiveSizePolicy;
42 class BarrierSet;
43 class CollectorPolicy;
44 class GCHeapSummary;
45 class GCTimer;
46 class GCTracer;
47 class MetaspaceSummary;
48 class Thread;
49 class ThreadClosure;
50 class VirtualSpaceSummary;
558
559 VirtualSpaceSummary create_heap_space_summary();
560 GCHeapSummary create_heap_summary();
561
562 MetaspaceSummary create_metaspace_summary();
563
564 // Print heap information on the given outputStream.
565 virtual void print_on(outputStream* st) const = 0;
566 // The default behavior is to call print_on() on tty.
567 virtual void print() const {
568 print_on(tty);
569 }
570 // Print more detailed heap information on the given
571 // outputStream. The default behavior is to call print_on(). It is
572 // up to each subclass to override it and add any additional output
573 // it needs.
574 virtual void print_extended_on(outputStream* st) const {
575 print_on(st);
576 }
577
578 virtual void print_on_error(outputStream* st) const;
579
580 // Print all GC threads (other than the VM thread)
581 // used by this heap.
582 virtual void print_gc_threads_on(outputStream* st) const = 0;
583 // The default behavior is to call print_gc_threads_on() on tty.
584 void print_gc_threads() {
585 print_gc_threads_on(tty);
586 }
587 // Iterator for all GC threads (other than VM thread)
588 virtual void gc_threads_do(ThreadClosure* tc) const = 0;
589
590 // Print any relevant tracing info that flags imply.
591 // Default implementation does nothing.
592 virtual void print_tracing_info() const = 0;
593
594 void print_heap_before_gc();
595 void print_heap_after_gc();
596
597 // Registering and unregistering an nmethod (compiled code) with the heap.
598 // Override with specific mechanism for each specialized heap type.
|