src/hotspot/share/gc/shared/collectedHeap.hpp
branchepsilon-gc-branch
changeset 55974 06122633fead
parent 55939 c5c3e1a5c3f0
parent 48168 cb5d2d4453d0
child 56276 ee5e58456be5
equal deleted inserted replaced
55939:c5c3e1a5c3f0 55974:06122633fead
    32 #include "runtime/perfData.hpp"
    32 #include "runtime/perfData.hpp"
    33 #include "runtime/safepoint.hpp"
    33 #include "runtime/safepoint.hpp"
    34 #include "utilities/debug.hpp"
    34 #include "utilities/debug.hpp"
    35 #include "utilities/events.hpp"
    35 #include "utilities/events.hpp"
    36 #include "utilities/formatBuffer.hpp"
    36 #include "utilities/formatBuffer.hpp"
       
    37 #include "utilities/growableArray.hpp"
    37 
    38 
    38 // A "CollectedHeap" is an implementation of a java heap for HotSpot.  This
    39 // A "CollectedHeap" is an implementation of a java heap for HotSpot.  This
    39 // is an abstract class: there may be many different kinds of heaps.  This
    40 // is an abstract class: there may be many different kinds of heaps.  This
    40 // class defines the functions that a heap must implement, and contains
    41 // class defines the functions that a heap must implement, and contains
    41 // infrastructure common to all heaps.
    42 // infrastructure common to all heaps.
    44 class BarrierSet;
    45 class BarrierSet;
    45 class CollectorPolicy;
    46 class CollectorPolicy;
    46 class GCHeapSummary;
    47 class GCHeapSummary;
    47 class GCTimer;
    48 class GCTimer;
    48 class GCTracer;
    49 class GCTracer;
       
    50 class GCMemoryManager;
       
    51 class MemoryPool;
    49 class MetaspaceSummary;
    52 class MetaspaceSummary;
    50 class Thread;
    53 class Thread;
    51 class ThreadClosure;
    54 class ThreadClosure;
    52 class VirtualSpaceSummary;
    55 class VirtualSpaceSummary;
    53 class WorkGang;
    56 class WorkGang;
   216   virtual jint initialize() = 0;
   219   virtual jint initialize() = 0;
   217 
   220 
   218   // In many heaps, there will be a need to perform some initialization activities
   221   // In many heaps, there will be a need to perform some initialization activities
   219   // after the Universe is fully formed, but before general heap allocation is allowed.
   222   // after the Universe is fully formed, but before general heap allocation is allowed.
   220   // This is the correct place to place such initialization methods.
   223   // This is the correct place to place such initialization methods.
   221   virtual void post_initialize() = 0;
   224   virtual void post_initialize();
   222 
   225 
   223   // Stop any onging concurrent work and prepare for exit.
   226   // Stop any onging concurrent work and prepare for exit.
   224   virtual void stop() {}
   227   virtual void stop() {}
   225 
   228 
   226   // Stop and resume concurrent GC threads interfering with safepoint operations
   229   // Stop and resume concurrent GC threads interfering with safepoint operations
   484   void increment_total_full_collections() { _total_full_collections++; }
   487   void increment_total_full_collections() { _total_full_collections++; }
   485 
   488 
   486   // Return the CollectorPolicy for the heap
   489   // Return the CollectorPolicy for the heap
   487   virtual CollectorPolicy* collector_policy() const = 0;
   490   virtual CollectorPolicy* collector_policy() const = 0;
   488 
   491 
       
   492   virtual GrowableArray<GCMemoryManager*> memory_managers() = 0;
       
   493   virtual GrowableArray<MemoryPool*> memory_pools() = 0;
       
   494 
   489   // Iterate over all objects, calling "cl.do_object" on each.
   495   // Iterate over all objects, calling "cl.do_object" on each.
   490   virtual void object_iterate(ObjectClosure* cl) = 0;
   496   virtual void object_iterate(ObjectClosure* cl) = 0;
   491 
   497 
   492   // Similar to object_iterate() except iterates only
   498   // Similar to object_iterate() except iterates only
   493   // over live objects.
   499   // over live objects.
   528   virtual void prepare_for_verify() = 0;
   534   virtual void prepare_for_verify() = 0;
   529 
   535 
   530   // Generate any dumps preceding or following a full gc
   536   // Generate any dumps preceding or following a full gc
   531  private:
   537  private:
   532   void full_gc_dump(GCTimer* timer, bool before);
   538   void full_gc_dump(GCTimer* timer, bool before);
       
   539 
       
   540   virtual void initialize_serviceability() = 0;
       
   541 
   533  public:
   542  public:
   534   void pre_full_gc_dump(GCTimer* timer);
   543   void pre_full_gc_dump(GCTimer* timer);
   535   void post_full_gc_dump(GCTimer* timer);
   544   void post_full_gc_dump(GCTimer* timer);
   536 
   545 
   537   VirtualSpaceSummary create_heap_space_summary();
   546   VirtualSpaceSummary create_heap_space_summary();