< prev index next >

src/share/vm/gc/shared/collectedHeap.hpp

Print this page
rev 13265 : 8180932: Parallelize safepoint cleanup
Summary: Provide infrastructure to do safepoint cleanup tasks using parallel worker threads
Reviewed-by: dholmes, rehn, dcubed, thartmann


  33 #include "runtime/safepoint.hpp"
  34 #include "utilities/debug.hpp"
  35 #include "utilities/events.hpp"
  36 #include "utilities/formatBuffer.hpp"
  37 
  38 // 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 // class defines the functions that a heap must implement, and contains
  41 // infrastructure common to all heaps.
  42 
  43 class AdaptiveSizePolicy;
  44 class BarrierSet;
  45 class CollectorPolicy;
  46 class GCHeapSummary;
  47 class GCTimer;
  48 class GCTracer;
  49 class MetaspaceSummary;
  50 class Thread;
  51 class ThreadClosure;
  52 class VirtualSpaceSummary;

  53 class nmethod;
  54 
  55 class GCMessage : public FormatBuffer<1024> {
  56  public:
  57   bool is_before;
  58 
  59  public:
  60   GCMessage() {}
  61 };
  62 
  63 class CollectedHeap;
  64 
  65 class GCHeapLog : public EventLogBase<GCMessage> {
  66  private:
  67   void log_heap(CollectedHeap* heap, bool before);
  68 
  69  public:
  70   GCHeapLog() : EventLogBase<GCMessage>("GC Heap History") {}
  71 
  72   void log_heap_before(CollectedHeap* heap) {


 585 
 586   // Return a NULL terminated array of concurrent phase names provided
 587   // by this collector.  Supports Whitebox testing.  These are the
 588   // names recognized by request_concurrent_phase(). The default
 589   // implementation returns an array of one NULL element.
 590   virtual const char* const* concurrent_phases() const;
 591 
 592   // Request the collector enter the indicated concurrent phase, and
 593   // wait until it does so.  Supports WhiteBox testing.  Only one
 594   // request may be active at a time.  Phases are designated by name;
 595   // the set of names and their meaning is GC-specific.  Once the
 596   // requested phase has been reached, the collector will attempt to
 597   // avoid transitioning to a new phase until a new request is made.
 598   // [Note: A collector might not be able to remain in a given phase.
 599   // For example, a full collection might cancel an in-progress
 600   // concurrent collection.]
 601   //
 602   // Returns true when the phase is reached.  Returns false for an
 603   // unknown phase.  The default implementation returns false.
 604   virtual bool request_concurrent_phase(const char* phase);










 605 
 606   // Non product verification and debugging.
 607 #ifndef PRODUCT
 608   // Support for PromotionFailureALot.  Return true if it's time to cause a
 609   // promotion failure.  The no-argument version uses
 610   // this->_promotion_failure_alot_count as the counter.
 611   inline bool promotion_should_fail(volatile size_t* count);
 612   inline bool promotion_should_fail();
 613 
 614   // Reset the PromotionFailureALot counters.  Should be called at the end of a
 615   // GC in which promotion failure occurred.
 616   inline void reset_promotion_should_fail(volatile size_t* count);
 617   inline void reset_promotion_should_fail();
 618 #endif  // #ifndef PRODUCT
 619 
 620 #ifdef ASSERT
 621   static int fired_fake_oom() {
 622     return (CIFireOOMAt > 1 && _fire_out_of_memory_count >= CIFireOOMAt);
 623   }
 624 #endif




  33 #include "runtime/safepoint.hpp"
  34 #include "utilities/debug.hpp"
  35 #include "utilities/events.hpp"
  36 #include "utilities/formatBuffer.hpp"
  37 
  38 // 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 // class defines the functions that a heap must implement, and contains
  41 // infrastructure common to all heaps.
  42 
  43 class AdaptiveSizePolicy;
  44 class BarrierSet;
  45 class CollectorPolicy;
  46 class GCHeapSummary;
  47 class GCTimer;
  48 class GCTracer;
  49 class MetaspaceSummary;
  50 class Thread;
  51 class ThreadClosure;
  52 class VirtualSpaceSummary;
  53 class WorkGang;
  54 class nmethod;
  55 
  56 class GCMessage : public FormatBuffer<1024> {
  57  public:
  58   bool is_before;
  59 
  60  public:
  61   GCMessage() {}
  62 };
  63 
  64 class CollectedHeap;
  65 
  66 class GCHeapLog : public EventLogBase<GCMessage> {
  67  private:
  68   void log_heap(CollectedHeap* heap, bool before);
  69 
  70  public:
  71   GCHeapLog() : EventLogBase<GCMessage>("GC Heap History") {}
  72 
  73   void log_heap_before(CollectedHeap* heap) {


 586 
 587   // Return a NULL terminated array of concurrent phase names provided
 588   // by this collector.  Supports Whitebox testing.  These are the
 589   // names recognized by request_concurrent_phase(). The default
 590   // implementation returns an array of one NULL element.
 591   virtual const char* const* concurrent_phases() const;
 592 
 593   // Request the collector enter the indicated concurrent phase, and
 594   // wait until it does so.  Supports WhiteBox testing.  Only one
 595   // request may be active at a time.  Phases are designated by name;
 596   // the set of names and their meaning is GC-specific.  Once the
 597   // requested phase has been reached, the collector will attempt to
 598   // avoid transitioning to a new phase until a new request is made.
 599   // [Note: A collector might not be able to remain in a given phase.
 600   // For example, a full collection might cancel an in-progress
 601   // concurrent collection.]
 602   //
 603   // Returns true when the phase is reached.  Returns false for an
 604   // unknown phase.  The default implementation returns false.
 605   virtual bool request_concurrent_phase(const char* phase);
 606 
 607   // Provides a thread pool to SafepointSynchronize to use
 608   // for parallel safepoint cleanup.
 609   // GCs that use a GC worker thread pool may want to share
 610   // it for use during safepoint cleanup. This is only possible
 611   // if the GC can pause and resume concurrent work (e.g. G1
 612   // concurrent marking) for an intermittent non-GC safepoint.
 613   // If this method returns NULL, SafepointSynchronize will
 614   // perform cleanup tasks serially in the VMThread.
 615   virtual WorkGang* get_safepoint_workers() { return NULL; }
 616 
 617   // Non product verification and debugging.
 618 #ifndef PRODUCT
 619   // Support for PromotionFailureALot.  Return true if it's time to cause a
 620   // promotion failure.  The no-argument version uses
 621   // this->_promotion_failure_alot_count as the counter.
 622   inline bool promotion_should_fail(volatile size_t* count);
 623   inline bool promotion_should_fail();
 624 
 625   // Reset the PromotionFailureALot counters.  Should be called at the end of a
 626   // GC in which promotion failure occurred.
 627   inline void reset_promotion_should_fail(volatile size_t* count);
 628   inline void reset_promotion_should_fail();
 629 #endif  // #ifndef PRODUCT
 630 
 631 #ifdef ASSERT
 632   static int fired_fake_oom() {
 633     return (CIFireOOMAt > 1 && _fire_out_of_memory_count >= CIFireOOMAt);
 634   }
 635 #endif


< prev index next >