src/share/vm/gc_implementation/shared/gcTrace.hpp

Print this page
rev 6084 : 8036703: Add trace event with statistics for the metaspace chunk free lists
rev 6085 : 8036703: incremental: webrev.03 -> webrev.04


  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_IMPLEMENTATION_SHARED_GCTRACE_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCTRACE_HPP
  27 
  28 #include "gc_interface/gcCause.hpp"
  29 #include "gc_interface/gcName.hpp"
  30 #include "gc_implementation/shared/gcWhen.hpp"
  31 #include "gc_implementation/shared/copyFailedInfo.hpp"
  32 #include "memory/allocation.hpp"

  33 #include "memory/referenceType.hpp"
  34 #if INCLUDE_ALL_GCS
  35 #include "gc_implementation/g1/g1YCTypes.hpp"
  36 #endif
  37 #include "utilities/macros.hpp"
  38 #include "utilities/ticks.hpp"
  39 
  40 typedef uint GCId;
  41 
  42 class EvacuationInfo;
  43 class GCHeapSummary;

  44 class MetaspaceSummary;
  45 class PSHeapSummary;
  46 class ReferenceProcessorStats;
  47 class TimePartitions;
  48 class BoolObjectClosure;
  49 
  50 class SharedGCInfo VALUE_OBJ_CLASS_SPEC {
  51  public:
  52   static const GCId UNSET_GCID = (GCId)-1;
  53 
  54  private:
  55   GCId _id;
  56   GCName _name;
  57   GCCause::Cause _cause;
  58   Ticks     _start_timestamp;
  59   Ticks     _end_timestamp;
  60   Tickspan  _sum_of_pauses;
  61   Tickspan  _longest_pause;
  62 
  63  public:


 107 
 108 class G1YoungGCInfo VALUE_OBJ_CLASS_SPEC {
 109   G1YCType _type;
 110  public:
 111   G1YoungGCInfo() : _type(G1YCTypeEndSentinel) {}
 112   void set_type(G1YCType type) {
 113     _type = type;
 114   }
 115   G1YCType type() const { return _type; }
 116 };
 117 
 118 #endif // INCLUDE_ALL_GCS
 119 
 120 class GCTracer : public ResourceObj {
 121  protected:
 122   SharedGCInfo _shared_gc_info;
 123 
 124  public:
 125   void report_gc_start(GCCause::Cause cause, const Ticks& timestamp);
 126   void report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions);
 127   void report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary, const MetaspaceSummary& meta_space_summary) const;

 128   void report_gc_reference_stats(const ReferenceProcessorStats& rp) const;
 129   void report_object_count_after_gc(BoolObjectClosure* object_filter) NOT_SERVICES_RETURN;
 130   bool has_reported_gc_start() const;
 131 
 132  protected:
 133   GCTracer(GCName name) : _shared_gc_info(name) {}
 134   virtual void report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp);
 135   virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
 136 
 137  private:
 138   void send_garbage_collection_event() const;
 139   void send_gc_heap_summary_event(GCWhen::Type when, const GCHeapSummary& heap_summary) const;
 140   void send_meta_space_summary_event(GCWhen::Type when, const MetaspaceSummary& meta_space_summary) const;

 141   void send_reference_stats_event(ReferenceType type, size_t count) const;
 142   void send_phase_events(TimePartitions* time_partitions) const;
 143 };
 144 
 145 class YoungGCTracer : public GCTracer {
 146   static const uint UNSET_TENURING_THRESHOLD = (uint) -1;
 147 
 148   uint _tenuring_threshold;
 149 
 150  protected:
 151   YoungGCTracer(GCName name) : GCTracer(name), _tenuring_threshold(UNSET_TENURING_THRESHOLD) {}
 152   virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
 153 
 154  public:
 155   void report_promotion_failed(const PromotionFailedInfo& pf_info);
 156   void report_tenuring_threshold(const uint tenuring_threshold);
 157 
 158  private:
 159   void send_young_gc_event() const;
 160   void send_promotion_failed_event(const PromotionFailedInfo& pf_info) const;




  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_IMPLEMENTATION_SHARED_GCTRACE_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCTRACE_HPP
  27 
  28 #include "gc_interface/gcCause.hpp"
  29 #include "gc_interface/gcName.hpp"
  30 #include "gc_implementation/shared/gcWhen.hpp"
  31 #include "gc_implementation/shared/copyFailedInfo.hpp"
  32 #include "memory/allocation.hpp"
  33 #include "memory/metaspace.hpp"
  34 #include "memory/referenceType.hpp"
  35 #if INCLUDE_ALL_GCS
  36 #include "gc_implementation/g1/g1YCTypes.hpp"
  37 #endif
  38 #include "utilities/macros.hpp"
  39 #include "utilities/ticks.hpp"
  40 
  41 typedef uint GCId;
  42 
  43 class EvacuationInfo;
  44 class GCHeapSummary;
  45 class MetaspaceChunkFreeListSummary;
  46 class MetaspaceSummary;
  47 class PSHeapSummary;
  48 class ReferenceProcessorStats;
  49 class TimePartitions;
  50 class BoolObjectClosure;
  51 
  52 class SharedGCInfo VALUE_OBJ_CLASS_SPEC {
  53  public:
  54   static const GCId UNSET_GCID = (GCId)-1;
  55 
  56  private:
  57   GCId _id;
  58   GCName _name;
  59   GCCause::Cause _cause;
  60   Ticks     _start_timestamp;
  61   Ticks     _end_timestamp;
  62   Tickspan  _sum_of_pauses;
  63   Tickspan  _longest_pause;
  64 
  65  public:


 109 
 110 class G1YoungGCInfo VALUE_OBJ_CLASS_SPEC {
 111   G1YCType _type;
 112  public:
 113   G1YoungGCInfo() : _type(G1YCTypeEndSentinel) {}
 114   void set_type(G1YCType type) {
 115     _type = type;
 116   }
 117   G1YCType type() const { return _type; }
 118 };
 119 
 120 #endif // INCLUDE_ALL_GCS
 121 
 122 class GCTracer : public ResourceObj {
 123  protected:
 124   SharedGCInfo _shared_gc_info;
 125 
 126  public:
 127   void report_gc_start(GCCause::Cause cause, const Ticks& timestamp);
 128   void report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions);
 129   void report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary) const;
 130   void report_metaspace_summary(GCWhen::Type when, const MetaspaceSummary& metaspace_summary) const;
 131   void report_gc_reference_stats(const ReferenceProcessorStats& rp) const;
 132   void report_object_count_after_gc(BoolObjectClosure* object_filter) NOT_SERVICES_RETURN;
 133   bool has_reported_gc_start() const;
 134 
 135  protected:
 136   GCTracer(GCName name) : _shared_gc_info(name) {}
 137   virtual void report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp);
 138   virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
 139 
 140  private:
 141   void send_garbage_collection_event() const;
 142   void send_gc_heap_summary_event(GCWhen::Type when, const GCHeapSummary& heap_summary) const;
 143   void send_meta_space_summary_event(GCWhen::Type when, const MetaspaceSummary& meta_space_summary) const;
 144   void send_metaspace_chunk_free_list_summary(GCWhen::Type when, Metaspace::MetadataType mdtype, const MetaspaceChunkFreeListSummary& summary) const;
 145   void send_reference_stats_event(ReferenceType type, size_t count) const;
 146   void send_phase_events(TimePartitions* time_partitions) const;
 147 };
 148 
 149 class YoungGCTracer : public GCTracer {
 150   static const uint UNSET_TENURING_THRESHOLD = (uint) -1;
 151 
 152   uint _tenuring_threshold;
 153 
 154  protected:
 155   YoungGCTracer(GCName name) : GCTracer(name), _tenuring_threshold(UNSET_TENURING_THRESHOLD) {}
 156   virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
 157 
 158  public:
 159   void report_promotion_failed(const PromotionFailedInfo& pf_info);
 160   void report_tenuring_threshold(const uint tenuring_threshold);
 161 
 162  private:
 163   void send_young_gc_event() const;
 164   void send_promotion_failed_event(const PromotionFailedInfo& pf_info) const;