< prev index next >

src/hotspot/share/gc/shared/gcTrace.hpp

Print this page




  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_GC_SHARED_GCTRACE_HPP
  26 #define SHARE_GC_SHARED_GCTRACE_HPP
  27 
  28 #include "gc/shared/copyFailedInfo.hpp"
  29 #include "gc/shared/gcCause.hpp"
  30 #include "gc/shared/gcId.hpp"
  31 #include "gc/shared/gcName.hpp"
  32 #include "gc/shared/gcWhen.hpp"
  33 #include "memory/metaspace.hpp"
  34 #include "memory/referenceType.hpp"
  35 #include "utilities/macros.hpp"
  36 #include "utilities/ticks.hpp"



  37 

  38 class GCHeapSummary;
  39 class MetaspaceChunkFreeListSummary;
  40 class MetaspaceSummary;
  41 class PSHeapSummary;


  42 class ReferenceProcessorStats;
  43 class TimePartitions;
  44 class BoolObjectClosure;
  45 
  46 class SharedGCInfo {
  47  private:
  48   GCName _name;
  49   GCCause::Cause _cause;
  50   Ticks     _start_timestamp;
  51   Ticks     _end_timestamp;
  52   Tickspan  _sum_of_pauses;
  53   Tickspan  _longest_pause;
  54 
  55  public:
  56   SharedGCInfo(GCName name) :
  57     _name(name),
  58     _cause(GCCause::_last_gc_cause),
  59     _start_timestamp(),
  60     _end_timestamp(),
  61     _sum_of_pauses(),


  74   void set_cause(GCCause::Cause cause) { _cause = cause; }
  75   GCCause::Cause cause() const { return _cause; }
  76 
  77   void set_sum_of_pauses(const Tickspan& duration) { _sum_of_pauses = duration; }
  78   const Tickspan sum_of_pauses() const { return _sum_of_pauses; }
  79 
  80   void set_longest_pause(const Tickspan& duration) { _longest_pause = duration; }
  81   const Tickspan longest_pause() const { return _longest_pause; }
  82 };
  83 
  84 class ParallelOldGCInfo {
  85   void* _dense_prefix;
  86  public:
  87   ParallelOldGCInfo() : _dense_prefix(NULL) {}
  88   void report_dense_prefix(void* addr) {
  89     _dense_prefix = addr;
  90   }
  91   void* dense_prefix() const { return _dense_prefix; }
  92 };
  93 














  94 class GCTracer : public ResourceObj {
  95  protected:
  96   SharedGCInfo _shared_gc_info;
  97 
  98  public:
  99   void report_gc_start(GCCause::Cause cause, const Ticks& timestamp);
 100   void report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions);
 101   void report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary) const;
 102   void report_metaspace_summary(GCWhen::Type when, const MetaspaceSummary& metaspace_summary) const;
 103   void report_gc_reference_stats(const ReferenceProcessorStats& rp) const;
 104   void report_object_count_after_gc(BoolObjectClosure* object_filter) NOT_SERVICES_RETURN;
 105 
 106  protected:
 107   GCTracer(GCName name) : _shared_gc_info(name) {}
 108   virtual void report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp);
 109   virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
 110 
 111  private:
 112   void send_garbage_collection_event() const;
 113   void send_gc_heap_summary_event(GCWhen::Type when, const GCHeapSummary& heap_summary) const;


 195 class SerialOldTracer : public OldGCTracer {
 196  public:
 197   SerialOldTracer() : OldGCTracer(SerialOld) {}
 198 };
 199 
 200 class ParallelScavengeTracer : public YoungGCTracer {
 201  public:
 202   ParallelScavengeTracer() : YoungGCTracer(ParallelScavenge) {}
 203 };
 204 
 205 class DefNewTracer : public YoungGCTracer {
 206  public:
 207   DefNewTracer() : YoungGCTracer(DefNew) {}
 208 };
 209 
 210 class ParNewTracer : public YoungGCTracer {
 211  public:
 212   ParNewTracer() : YoungGCTracer(ParNew) {}
 213 };
 214 
































































 215 class CMSTracer : public OldGCTracer {
 216  public:
 217   CMSTracer() : OldGCTracer(ConcurrentMarkSweep) {}








 218 };
 219 
 220 #endif // SHARE_GC_SHARED_GCTRACE_HPP


  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_GC_SHARED_GCTRACE_HPP
  26 #define SHARE_GC_SHARED_GCTRACE_HPP
  27 
  28 #include "gc/shared/copyFailedInfo.hpp"
  29 #include "gc/shared/gcCause.hpp"
  30 #include "gc/shared/gcId.hpp"
  31 #include "gc/shared/gcName.hpp"
  32 #include "gc/shared/gcWhen.hpp"
  33 #include "memory/metaspace.hpp"
  34 #include "memory/referenceType.hpp"
  35 #include "utilities/macros.hpp"
  36 #include "utilities/ticks.hpp"
  37 #if INCLUDE_G1GC
  38 #include "gc/g1/g1YCTypes.hpp"
  39 #endif
  40 
  41 class G1EvacuationInfo;
  42 class GCHeapSummary;
  43 class MetaspaceChunkFreeListSummary;
  44 class MetaspaceSummary;
  45 class PSHeapSummary;
  46 class G1HeapSummary;
  47 class G1EvacSummary;
  48 class ReferenceProcessorStats;
  49 class TimePartitions;
  50 class BoolObjectClosure;
  51 
  52 class SharedGCInfo {
  53  private:
  54   GCName _name;
  55   GCCause::Cause _cause;
  56   Ticks     _start_timestamp;
  57   Ticks     _end_timestamp;
  58   Tickspan  _sum_of_pauses;
  59   Tickspan  _longest_pause;
  60 
  61  public:
  62   SharedGCInfo(GCName name) :
  63     _name(name),
  64     _cause(GCCause::_last_gc_cause),
  65     _start_timestamp(),
  66     _end_timestamp(),
  67     _sum_of_pauses(),


  80   void set_cause(GCCause::Cause cause) { _cause = cause; }
  81   GCCause::Cause cause() const { return _cause; }
  82 
  83   void set_sum_of_pauses(const Tickspan& duration) { _sum_of_pauses = duration; }
  84   const Tickspan sum_of_pauses() const { return _sum_of_pauses; }
  85 
  86   void set_longest_pause(const Tickspan& duration) { _longest_pause = duration; }
  87   const Tickspan longest_pause() const { return _longest_pause; }
  88 };
  89 
  90 class ParallelOldGCInfo {
  91   void* _dense_prefix;
  92  public:
  93   ParallelOldGCInfo() : _dense_prefix(NULL) {}
  94   void report_dense_prefix(void* addr) {
  95     _dense_prefix = addr;
  96   }
  97   void* dense_prefix() const { return _dense_prefix; }
  98 };
  99 
 100 #if INCLUDE_G1GC
 101 
 102 class G1YoungGCInfo {
 103   G1YCType _type;
 104  public:
 105   G1YoungGCInfo() : _type(G1YCTypeEndSentinel) {}
 106   void set_type(G1YCType type) {
 107     _type = type;
 108   }
 109   G1YCType type() const { return _type; }
 110 };
 111 
 112 #endif // INCLUDE_G1GC
 113 
 114 class GCTracer : public ResourceObj {
 115  protected:
 116   SharedGCInfo _shared_gc_info;
 117 
 118  public:
 119   void report_gc_start(GCCause::Cause cause, const Ticks& timestamp);
 120   void report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions);
 121   void report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary) const;
 122   void report_metaspace_summary(GCWhen::Type when, const MetaspaceSummary& metaspace_summary) const;
 123   void report_gc_reference_stats(const ReferenceProcessorStats& rp) const;
 124   void report_object_count_after_gc(BoolObjectClosure* object_filter) NOT_SERVICES_RETURN;
 125 
 126  protected:
 127   GCTracer(GCName name) : _shared_gc_info(name) {}
 128   virtual void report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp);
 129   virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
 130 
 131  private:
 132   void send_garbage_collection_event() const;
 133   void send_gc_heap_summary_event(GCWhen::Type when, const GCHeapSummary& heap_summary) const;


 215 class SerialOldTracer : public OldGCTracer {
 216  public:
 217   SerialOldTracer() : OldGCTracer(SerialOld) {}
 218 };
 219 
 220 class ParallelScavengeTracer : public YoungGCTracer {
 221  public:
 222   ParallelScavengeTracer() : YoungGCTracer(ParallelScavenge) {}
 223 };
 224 
 225 class DefNewTracer : public YoungGCTracer {
 226  public:
 227   DefNewTracer() : YoungGCTracer(DefNew) {}
 228 };
 229 
 230 class ParNewTracer : public YoungGCTracer {
 231  public:
 232   ParNewTracer() : YoungGCTracer(ParNew) {}
 233 };
 234 
 235 #if INCLUDE_G1GC
 236 class G1MMUTracer : public AllStatic {
 237   static void send_g1_mmu_event(double time_slice_ms, double gc_time_ms, double max_time_ms);
 238 
 239  public:
 240   static void report_mmu(double time_slice_sec, double gc_time_sec, double max_time_sec);
 241 };
 242 
 243 class G1NewTracer : public YoungGCTracer {
 244   G1YoungGCInfo _g1_young_gc_info;
 245 
 246  public:
 247   G1NewTracer() : YoungGCTracer(G1New) {}
 248 
 249   void report_yc_type(G1YCType type);
 250   void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
 251   void report_evacuation_info(G1EvacuationInfo* info);
 252   void report_evacuation_failed(EvacuationFailedInfo& ef_info);
 253 
 254   void report_evacuation_statistics(const G1EvacSummary& young_summary, const G1EvacSummary& old_summary) const;
 255 
 256   void report_basic_ihop_statistics(size_t threshold,
 257                                     size_t target_occupancy,
 258                                     size_t current_occupancy,
 259                                     size_t last_allocation_size,
 260                                     double last_allocation_duration,
 261                                     double last_marking_length);
 262   void report_adaptive_ihop_statistics(size_t threshold,
 263                                        size_t internal_target_occupancy,
 264                                        size_t current_occupancy,
 265                                        size_t additional_buffer_size,
 266                                        double predicted_allocation_rate,
 267                                        double predicted_marking_length,
 268                                        bool prediction_active);
 269  private:
 270   void send_g1_young_gc_event();
 271   void send_evacuation_info_event(G1EvacuationInfo* info);
 272   void send_evacuation_failed_event(const EvacuationFailedInfo& ef_info) const;
 273 
 274   void send_young_evacuation_statistics(const G1EvacSummary& summary) const;
 275   void send_old_evacuation_statistics(const G1EvacSummary& summary) const;
 276 
 277   void send_basic_ihop_statistics(size_t threshold,
 278                                   size_t target_occupancy,
 279                                   size_t current_occupancy,
 280                                   size_t last_allocation_size,
 281                                   double last_allocation_duration,
 282                                   double last_marking_length);
 283   void send_adaptive_ihop_statistics(size_t threshold,
 284                                      size_t internal_target_occupancy,
 285                                      size_t current_occupancy,
 286                                      size_t additional_buffer_size,
 287                                      double predicted_allocation_rate,
 288                                      double predicted_marking_length,
 289                                      bool prediction_active);
 290 };
 291 
 292 class G1FullGCTracer : public OldGCTracer {
 293  public:
 294   G1FullGCTracer() : OldGCTracer(G1Full) {}
 295 };
 296 
 297 #endif // INCLUDE_G1GC
 298 
 299 class CMSTracer : public OldGCTracer {
 300  public:
 301   CMSTracer() : OldGCTracer(ConcurrentMarkSweep) {}
 302 };
 303 
 304 class G1OldTracer : public OldGCTracer {
 305  protected:
 306   void report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp);
 307  public:
 308   G1OldTracer() : OldGCTracer(G1Old) {}
 309   void set_gc_cause(GCCause::Cause cause);
 310 };
 311 
 312 #endif // SHARE_GC_SHARED_GCTRACE_HPP
< prev index next >