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

Print this page
rev 6072 : 8036703: Add trace event with statistics for the metaspace chunk free lists


  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;


 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;
 161 };
 162 




  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 MetaspaceSummary;
  46 class PSHeapSummary;
  47 class ReferenceProcessorStats;
  48 class TimePartitions;
  49 class BoolObjectClosure;
  50 
  51 class SharedGCInfo VALUE_OBJ_CLASS_SPEC {
  52  public:
  53   static const GCId UNSET_GCID = (GCId)-1;


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