< prev index next >

src/share/vm/gc/g1/g1MonitoringSupport.cpp

Print this page




  59     update_all();
  60   }
  61 }
  62 
  63 void G1YoungGenerationCounters::update_all() {
  64   size_t committed =
  65             G1MonitoringSupport::pad_capacity(_g1mm->young_gen_committed(), 3);
  66   _current_size->set_value(committed);
  67 }
  68 
  69 void G1OldGenerationCounters::update_all() {
  70   size_t committed =
  71             G1MonitoringSupport::pad_capacity(_g1mm->old_gen_committed());
  72   _current_size->set_value(committed);
  73 }
  74 
  75 G1MonitoringSupport::G1MonitoringSupport(G1CollectedHeap* g1h) :
  76   _g1h(g1h),
  77   _incremental_collection_counters(NULL),
  78   _full_collection_counters(NULL),

  79   _old_collection_counters(NULL),
  80   _old_space_counters(NULL),
  81   _young_collection_counters(NULL),
  82   _eden_counters(NULL),
  83   _from_counters(NULL),
  84   _to_counters(NULL),
  85 
  86   _overall_reserved(0),
  87   _overall_committed(0),    _overall_used(0),
  88   _young_region_num(0),
  89   _young_gen_committed(0),
  90   _eden_committed(0),       _eden_used(0),
  91   _survivor_committed(0),   _survivor_used(0),
  92   _old_committed(0),        _old_used(0) {
  93 
  94   _overall_reserved = g1h->max_capacity();
  95   recalculate_sizes();
  96 
  97   // Counters for GC collections
  98   //
  99   //  name "collector.0".  In a generational collector this would be the
 100   // young generation collection.
 101   _incremental_collection_counters =
 102     new CollectorCounters("G1 incremental collections", 0);
 103   //   name "collector.1".  In a generational collector this would be the
 104   // old generation collection.
 105   _full_collection_counters =
 106     new CollectorCounters("G1 stop-the-world full collections", 1);




 107 
 108   // timer sampling for all counters supporting sampling only update the
 109   // used value.  See the take_sample() method.  G1 requires both used and
 110   // capacity updated so sampling is not currently used.  It might
 111   // be sufficient to update all counters in take_sample() even though
 112   // take_sample() only returns "used".  When sampling was used, there
 113   // were some anomolous values emitted which may have been the consequence
 114   // of not updating all values simultaneously (i.e., see the calculation done
 115   // in eden_space_used(), is it possible that the values used to
 116   // calculate either eden_used or survivor_used are being updated by
 117   // the collector when the sample is being done?).
 118   const bool sampled = false;
 119 
 120   // "Generation" and "Space" counters.
 121   //
 122   //  name "generation.1" This is logically the old generation in
 123   // generational GC terms.  The "1, 1" parameters are for
 124   // the n-th generation (=1) with 1 space.
 125   // Counters are created from minCapacity, maxCapacity, and capacity
 126   _old_collection_counters = new G1OldGenerationCounters(this, "old");




  59     update_all();
  60   }
  61 }
  62 
  63 void G1YoungGenerationCounters::update_all() {
  64   size_t committed =
  65             G1MonitoringSupport::pad_capacity(_g1mm->young_gen_committed(), 3);
  66   _current_size->set_value(committed);
  67 }
  68 
  69 void G1OldGenerationCounters::update_all() {
  70   size_t committed =
  71             G1MonitoringSupport::pad_capacity(_g1mm->old_gen_committed());
  72   _current_size->set_value(committed);
  73 }
  74 
  75 G1MonitoringSupport::G1MonitoringSupport(G1CollectedHeap* g1h) :
  76   _g1h(g1h),
  77   _incremental_collection_counters(NULL),
  78   _full_collection_counters(NULL),
  79   _conc_collection_counters(NULL),
  80   _old_collection_counters(NULL),
  81   _old_space_counters(NULL),
  82   _young_collection_counters(NULL),
  83   _eden_counters(NULL),
  84   _from_counters(NULL),
  85   _to_counters(NULL),
  86 
  87   _overall_reserved(0),
  88   _overall_committed(0),    _overall_used(0),
  89   _young_region_num(0),
  90   _young_gen_committed(0),
  91   _eden_committed(0),       _eden_used(0),
  92   _survivor_committed(0),   _survivor_used(0),
  93   _old_committed(0),        _old_used(0) {
  94 
  95   _overall_reserved = g1h->max_capacity();
  96   recalculate_sizes();
  97 
  98   // Counters for GC collections
  99   //
 100   //  name "collector.0".  In a generational collector this would be the
 101   // young generation collection.
 102   _incremental_collection_counters =
 103     new CollectorCounters("G1 incremental collections", 0);
 104   //   name "collector.1".  In a generational collector this would be the
 105   // old generation collection.
 106   _full_collection_counters =
 107     new CollectorCounters("G1 stop-the-world full collections", 1);
 108   //   name "collector.2".  In a generational collector this would be the
 109   // STW phases in concurrent collection.
 110   _conc_collection_counters =
 111     new CollectorCounters("G1 stop-the-world phases", 2);
 112 
 113   // timer sampling for all counters supporting sampling only update the
 114   // used value.  See the take_sample() method.  G1 requires both used and
 115   // capacity updated so sampling is not currently used.  It might
 116   // be sufficient to update all counters in take_sample() even though
 117   // take_sample() only returns "used".  When sampling was used, there
 118   // were some anomolous values emitted which may have been the consequence
 119   // of not updating all values simultaneously (i.e., see the calculation done
 120   // in eden_space_used(), is it possible that the values used to
 121   // calculate either eden_used or survivor_used are being updated by
 122   // the collector when the sample is being done?).
 123   const bool sampled = false;
 124 
 125   // "Generation" and "Space" counters.
 126   //
 127   //  name "generation.1" This is logically the old generation in
 128   // generational GC terms.  The "1, 1" parameters are for
 129   // the n-th generation (=1) with 1 space.
 130   // Counters are created from minCapacity, maxCapacity, and capacity
 131   _old_collection_counters = new G1OldGenerationCounters(this, "old");


< prev index next >