Print this page
rev 4524 : 8012086: The object count event should only send events for instances occupying more than 0.5% of the heap
Reviewed-by: brutisso, jwilhelm

Split Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/shared/gcTrace.hpp
          +++ new/src/share/vm/gc_implementation/shared/gcTrace.hpp
↓ open down ↓ 22 lines elided ↑ open up ↑
  23   23   */
  24   24  
  25   25  #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GCTRACE_HPP
  26   26  #define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCTRACE_HPP
  27   27  
  28   28  #include "gc_interface/gcCause.hpp"
  29   29  #include "gc_interface/gcName.hpp"
  30   30  #include "gc_implementation/shared/gcWhen.hpp"
  31   31  #include "gc_implementation/shared/copyFailedInfo.hpp"
  32   32  #include "memory/allocation.hpp"
       33 +#include "memory/klassInfoClosure.hpp"
  33   34  #include "memory/referenceType.hpp"
  34   35  #ifndef SERIALGC
  35   36  #include "gc_implementation/g1/g1YCTypes.hpp"
  36   37  #endif
  37   38  
  38   39  typedef uint GCId;
  39   40  
  40   41  class EvacuationInfo;
  41   42  class GCHeapSummary;
  42   43  class PermGenSummary;
↓ open down ↓ 89 lines elided ↑ open up ↑
 132  133   private:
 133  134    void send_garbage_collection_event() const;
 134  135    void send_gc_heap_summary_event(GCWhen::Type when, const GCHeapSummary& heap_summary) const;
 135  136    void send_perm_gen_summary_event(GCWhen::Type when, const PermGenSummary& perm_gen_summary) const;
 136  137    void send_reference_stats_event(ReferenceType type, size_t count) const;
 137  138    void send_phase_events(TimePartitions* time_partitions) const;
 138  139    void send_object_count_after_gc_event(klassOop klass, jlong count, julong total_size) const;
 139  140    bool should_send_object_count_after_gc_event() const;
 140  141  };
 141  142  
      143 +class ObjectCountEventSenderClosure : public KlassInfoClosure {
      144 +  GCTracer* _gc_tracer;
      145 +  const double _size_threshold_percentage;
      146 +  const size_t _total_size_in_words;
      147 + public:
      148 +  ObjectCountEventSenderClosure(GCTracer* gc_tracer, size_t total_size_in_words) :
      149 +    _gc_tracer(gc_tracer),
      150 +    _size_threshold_percentage(ObjectCountCutOffPercent / 100),
      151 +    _total_size_in_words(total_size_in_words)
      152 +  {}
      153 +  virtual void do_cinfo(KlassInfoEntry* entry);
      154 + protected:
      155 +  virtual void send_event(KlassInfoEntry* entry);
      156 + private:
      157 +  bool should_send_event(KlassInfoEntry* entry) const;
      158 +};
      159 +
      160 +class ObjectCountFilter : public BoolObjectClosure {
      161 +  BoolObjectClosure* _is_alive;
      162 + public:
      163 +  ObjectCountFilter(BoolObjectClosure* is_alive = NULL) : _is_alive(is_alive) {}
      164 +  bool do_object_b(oop obj);
      165 +  void do_object(oop obj) { ShouldNotReachHere(); }
      166 + private:
      167 +  bool is_externally_visible_klass(klassOop k) const;
      168 +};
      169 +
 142  170  class YoungGCTracer : public GCTracer {
 143  171    static const uint UNSET_TENURING_THRESHOLD = (uint) -1;
 144  172  
 145  173    uint _tenuring_threshold;
 146  174  
 147  175   protected:
 148  176    YoungGCTracer(GCName name) : GCTracer(name), _tenuring_threshold(UNSET_TENURING_THRESHOLD) {}
 149  177    virtual void report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions);
 150  178  
 151  179   public:
↓ open down ↓ 85 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX