< prev index next >

src/share/vm/gc/g1/g1CollectorPolicy.hpp

Print this page
rev 10472 : 8151711: Move G1 number sequences out of the G1 collector policy
Reviewed-by:
rev 10473 : [mq]: rename-to-analytics


  26 #define SHARE_VM_GC_G1_G1COLLECTORPOLICY_HPP
  27 
  28 #include "gc/g1/g1CollectorState.hpp"
  29 #include "gc/g1/g1GCPhaseTimes.hpp"
  30 #include "gc/g1/g1InCSetState.hpp"
  31 #include "gc/g1/g1InitialMarkToMixedTimeTracker.hpp"
  32 #include "gc/g1/g1MMUTracker.hpp"
  33 #include "gc/g1/g1Predictions.hpp"
  34 #include "gc/shared/collectorPolicy.hpp"
  35 #include "utilities/pair.hpp"
  36 
  37 // A G1CollectorPolicy makes policy decisions that determine the
  38 // characteristics of the collector.  Examples include:
  39 //   * choice of collection set.
  40 //   * when to collect.
  41 
  42 class HeapRegion;
  43 class G1CollectionSet;
  44 class CollectionSetChooser;
  45 class G1IHOPControl;
  46 class G1Measurements;
  47 class G1YoungGenSizer;
  48 
  49 class G1CollectorPolicy: public CollectorPolicy {
  50  private:
  51   G1IHOPControl* _ihop_control;
  52 
  53   G1IHOPControl* create_ihop_control() const;
  54   // Update the IHOP control with necessary statistics.
  55   void update_ihop_prediction(double mutator_time_s,
  56                               size_t mutator_alloc_bytes,
  57                               size_t young_gen_size);
  58   void report_ihop_statistics();
  59 
  60   G1Predictions _predictor;
  61   G1Measurements* _measurements;
  62 
  63   G1MMUTracker* _mmu_tracker;
  64 
  65   void initialize_alignments();
  66   void initialize_flags();
  67 
  68   double _full_collection_start_sec;
  69 
  70   // Ratio check data for determining if heap growth is necessary.
  71   uint _ratio_over_threshold_count;
  72   double _ratio_over_threshold_sum;
  73   uint _pauses_since_start;
  74 
  75   uint _young_list_target_length;
  76   uint _young_list_fixed_length;
  77 
  78   // The max number of regions we can extend the eden by while the GC
  79   // locker is active. This should be >= _young_list_target_length;
  80   uint _young_list_max_length;
  81 


 104 
 105 #ifndef PRODUCT
 106   bool verify_young_ages(HeapRegion* head, SurvRateGroup *surv_rate_group);
 107 #endif // PRODUCT
 108 
 109   void adjust_concurrent_refinement(double update_rs_time,
 110                                     double update_rs_processed_buffers,
 111                                     double goal_ms);
 112 
 113   double _pause_time_target_ms;
 114 
 115   size_t _pending_cards;
 116 
 117   // The amount of allocated bytes in old gen during the last mutator and the following
 118   // young GC phase.
 119   size_t _bytes_allocated_in_old_since_last_gc;
 120 
 121   G1InitialMarkToMixedTimeTracker _initial_mark_to_mixed;
 122 public:
 123   const G1Predictions& predictor() const { return _predictor; }
 124   const G1Measurements* measurements() { return const_cast<const G1Measurements*>(_measurements); }
 125 
 126   // Add the given number of bytes to the total number of allocated bytes in the old gen.
 127   void add_bytes_allocated_in_old_since_last_gc(size_t bytes) { _bytes_allocated_in_old_since_last_gc += bytes; }
 128 
 129   // Accessors
 130 
 131   void set_region_eden(HeapRegion* hr, int young_index_in_cset) {
 132     hr->set_eden();
 133     hr->install_surv_rate_group(_short_lived_surv_rate_group);
 134     hr->set_young_index_in_cset(young_index_in_cset);
 135   }
 136 
 137   void set_region_survivor(HeapRegion* hr, int young_index_in_cset) {
 138     assert(hr->is_survivor(), "pre-condition");
 139     hr->install_surv_rate_group(_survivor_surv_rate_group);
 140     hr->set_young_index_in_cset(young_index_in_cset);
 141   }
 142 
 143 #ifndef PRODUCT
 144   bool verify_young_ages();




  26 #define SHARE_VM_GC_G1_G1COLLECTORPOLICY_HPP
  27 
  28 #include "gc/g1/g1CollectorState.hpp"
  29 #include "gc/g1/g1GCPhaseTimes.hpp"
  30 #include "gc/g1/g1InCSetState.hpp"
  31 #include "gc/g1/g1InitialMarkToMixedTimeTracker.hpp"
  32 #include "gc/g1/g1MMUTracker.hpp"
  33 #include "gc/g1/g1Predictions.hpp"
  34 #include "gc/shared/collectorPolicy.hpp"
  35 #include "utilities/pair.hpp"
  36 
  37 // A G1CollectorPolicy makes policy decisions that determine the
  38 // characteristics of the collector.  Examples include:
  39 //   * choice of collection set.
  40 //   * when to collect.
  41 
  42 class HeapRegion;
  43 class G1CollectionSet;
  44 class CollectionSetChooser;
  45 class G1IHOPControl;
  46 class G1Analytics;
  47 class G1YoungGenSizer;
  48 
  49 class G1CollectorPolicy: public CollectorPolicy {
  50  private:
  51   G1IHOPControl* _ihop_control;
  52 
  53   G1IHOPControl* create_ihop_control() const;
  54   // Update the IHOP control with necessary statistics.
  55   void update_ihop_prediction(double mutator_time_s,
  56                               size_t mutator_alloc_bytes,
  57                               size_t young_gen_size);
  58   void report_ihop_statistics();
  59 
  60   G1Predictions _predictor;
  61   G1Analytics* _analytics;
  62 
  63   G1MMUTracker* _mmu_tracker;
  64 
  65   void initialize_alignments();
  66   void initialize_flags();
  67 
  68   double _full_collection_start_sec;
  69 
  70   // Ratio check data for determining if heap growth is necessary.
  71   uint _ratio_over_threshold_count;
  72   double _ratio_over_threshold_sum;
  73   uint _pauses_since_start;
  74 
  75   uint _young_list_target_length;
  76   uint _young_list_fixed_length;
  77 
  78   // The max number of regions we can extend the eden by while the GC
  79   // locker is active. This should be >= _young_list_target_length;
  80   uint _young_list_max_length;
  81 


 104 
 105 #ifndef PRODUCT
 106   bool verify_young_ages(HeapRegion* head, SurvRateGroup *surv_rate_group);
 107 #endif // PRODUCT
 108 
 109   void adjust_concurrent_refinement(double update_rs_time,
 110                                     double update_rs_processed_buffers,
 111                                     double goal_ms);
 112 
 113   double _pause_time_target_ms;
 114 
 115   size_t _pending_cards;
 116 
 117   // The amount of allocated bytes in old gen during the last mutator and the following
 118   // young GC phase.
 119   size_t _bytes_allocated_in_old_since_last_gc;
 120 
 121   G1InitialMarkToMixedTimeTracker _initial_mark_to_mixed;
 122 public:
 123   const G1Predictions& predictor() const { return _predictor; }
 124   const G1Analytics* analytics()   const { return const_cast<const G1Analytics*>(_analytics); }
 125 
 126   // Add the given number of bytes to the total number of allocated bytes in the old gen.
 127   void add_bytes_allocated_in_old_since_last_gc(size_t bytes) { _bytes_allocated_in_old_since_last_gc += bytes; }
 128 
 129   // Accessors
 130 
 131   void set_region_eden(HeapRegion* hr, int young_index_in_cset) {
 132     hr->set_eden();
 133     hr->install_surv_rate_group(_short_lived_surv_rate_group);
 134     hr->set_young_index_in_cset(young_index_in_cset);
 135   }
 136 
 137   void set_region_survivor(HeapRegion* hr, int young_index_in_cset) {
 138     assert(hr->is_survivor(), "pre-condition");
 139     hr->install_surv_rate_group(_survivor_surv_rate_group);
 140     hr->set_young_index_in_cset(young_index_in_cset);
 141   }
 142 
 143 #ifndef PRODUCT
 144   bool verify_young_ages();


< prev index next >