< prev index next >

src/hotspot/share/gc/parallel/psGCAdaptivePolicyCounters.hpp

Print this page
rev 53341 : 8212206: Refactor AdaptiveSizePolicy to separate out code related to GC overhead
Summary: Move check_gc_overhead_limit() and related code to its own class
Reviewed-by:


  34 // parallel scavenge collector.
  35 
  36 class PSGCAdaptivePolicyCounters : public GCAdaptivePolicyCounters {
  37   friend class VMStructs;
  38 
  39  private:
  40   // survivor space vs. tenuring threshold
  41   PerfVariable* _old_promo_size;
  42   PerfVariable* _old_eden_size;
  43   PerfVariable* _avg_promoted_avg_counter;
  44   PerfVariable* _avg_promoted_dev_counter;
  45   PerfVariable* _avg_promoted_padded_avg_counter;
  46   PerfVariable* _avg_pretenured_padded_avg;
  47 
  48   // young gen vs. old gen sizing
  49   PerfVariable* _avg_major_pause;
  50   PerfVariable* _avg_major_interval;
  51   PerfVariable* _live_space;
  52   PerfVariable* _free_space;
  53   PerfVariable* _avg_base_footprint;
  54   PerfVariable* _gc_overhead_limit_exceeded_counter;
  55   PerfVariable* _live_at_last_full_gc_counter;
  56   PerfVariable* _old_capacity;
  57   PerfVariable* _boundary_moved;
  58 
  59   PerfVariable* _change_old_gen_for_min_pauses;
  60   PerfVariable* _change_young_gen_for_maj_pauses_counter;
  61 
  62   PerfVariable* _major_pause_old_slope;
  63   PerfVariable* _minor_pause_old_slope;
  64   PerfVariable* _major_pause_young_slope;
  65 
  66   PerfVariable* _scavenge_skipped;
  67   PerfVariable* _full_follows_scavenge;
  68 
  69   // Use this time stamp if the gc time stamp is not available.
  70   TimeStamp     _counter_time_stamp;
  71 
  72  protected:
  73   PSAdaptiveSizePolicy* ps_size_policy() {
  74     return (PSAdaptiveSizePolicy*)_size_policy;


 160       (jlong)(ps_size_policy()->avg_old_live()->average())
 161     );
 162   }
 163   // Scale up all the slopes
 164   inline void update_major_pause_old_slope() {
 165     _major_pause_old_slope->set_value(
 166       (jlong)(ps_size_policy()->major_pause_old_slope() * 1000)
 167     );
 168   }
 169   inline void update_minor_pause_old_slope() {
 170     _minor_pause_old_slope->set_value(
 171       (jlong)(ps_size_policy()->minor_pause_old_slope() * 1000)
 172     );
 173   }
 174   inline void update_major_pause_young_slope() {
 175     _major_pause_young_slope->set_value(
 176       (jlong)(ps_size_policy()->major_pause_young_slope() * 1000)
 177     );
 178   }
 179   inline void update_gc_overhead_limit_exceeded_counter() {
 180     _gc_overhead_limit_exceeded_counter->set_value(
 181       (jlong) ps_size_policy()->gc_overhead_limit_exceeded());
 182   }
 183   inline void update_live_at_last_full_gc_counter() {
 184     _live_at_last_full_gc_counter->set_value(
 185       (jlong)(ps_size_policy()->live_at_last_full_gc()));
 186   }
 187 
 188   inline void update_scavenge_skipped(int cause) {
 189     _scavenge_skipped->set_value(cause);
 190   }
 191 
 192   inline void update_full_follows_scavenge(int event) {
 193     _full_follows_scavenge->set_value(event);
 194   }
 195 
 196   // Update all the counters that can be updated from the size policy.
 197   // This should be called after all policy changes have been made
 198   // and reflected internally in the size policy.
 199   void update_counters_from_policy();
 200 


  34 // parallel scavenge collector.
  35 
  36 class PSGCAdaptivePolicyCounters : public GCAdaptivePolicyCounters {
  37   friend class VMStructs;
  38 
  39  private:
  40   // survivor space vs. tenuring threshold
  41   PerfVariable* _old_promo_size;
  42   PerfVariable* _old_eden_size;
  43   PerfVariable* _avg_promoted_avg_counter;
  44   PerfVariable* _avg_promoted_dev_counter;
  45   PerfVariable* _avg_promoted_padded_avg_counter;
  46   PerfVariable* _avg_pretenured_padded_avg;
  47 
  48   // young gen vs. old gen sizing
  49   PerfVariable* _avg_major_pause;
  50   PerfVariable* _avg_major_interval;
  51   PerfVariable* _live_space;
  52   PerfVariable* _free_space;
  53   PerfVariable* _avg_base_footprint;

  54   PerfVariable* _live_at_last_full_gc_counter;
  55   PerfVariable* _old_capacity;
  56   PerfVariable* _boundary_moved;
  57 
  58   PerfVariable* _change_old_gen_for_min_pauses;
  59   PerfVariable* _change_young_gen_for_maj_pauses_counter;
  60 
  61   PerfVariable* _major_pause_old_slope;
  62   PerfVariable* _minor_pause_old_slope;
  63   PerfVariable* _major_pause_young_slope;
  64 
  65   PerfVariable* _scavenge_skipped;
  66   PerfVariable* _full_follows_scavenge;
  67 
  68   // Use this time stamp if the gc time stamp is not available.
  69   TimeStamp     _counter_time_stamp;
  70 
  71  protected:
  72   PSAdaptiveSizePolicy* ps_size_policy() {
  73     return (PSAdaptiveSizePolicy*)_size_policy;


 159       (jlong)(ps_size_policy()->avg_old_live()->average())
 160     );
 161   }
 162   // Scale up all the slopes
 163   inline void update_major_pause_old_slope() {
 164     _major_pause_old_slope->set_value(
 165       (jlong)(ps_size_policy()->major_pause_old_slope() * 1000)
 166     );
 167   }
 168   inline void update_minor_pause_old_slope() {
 169     _minor_pause_old_slope->set_value(
 170       (jlong)(ps_size_policy()->minor_pause_old_slope() * 1000)
 171     );
 172   }
 173   inline void update_major_pause_young_slope() {
 174     _major_pause_young_slope->set_value(
 175       (jlong)(ps_size_policy()->major_pause_young_slope() * 1000)
 176     );
 177   }
 178   inline void update_gc_overhead_limit_exceeded_counter() {
 179     gc_overhead_limit_exceeded_counter()->set_value(
 180       (jlong) ps_size_policy()->gc_overhead_limit_exceeded());
 181   }
 182   inline void update_live_at_last_full_gc_counter() {
 183     _live_at_last_full_gc_counter->set_value(
 184       (jlong)(ps_size_policy()->live_at_last_full_gc()));
 185   }
 186 
 187   inline void update_scavenge_skipped(int cause) {
 188     _scavenge_skipped->set_value(cause);
 189   }
 190 
 191   inline void update_full_follows_scavenge(int event) {
 192     _full_follows_scavenge->set_value(event);
 193   }
 194 
 195   // Update all the counters that can be updated from the size policy.
 196   // This should be called after all policy changes have been made
 197   // and reflected internally in the size policy.
 198   void update_counters_from_policy();
 199 
< prev index next >