src/hotspot/share/gc/g1/g1Policy.hpp
changeset 49643 a3453bbd5418
parent 49632 64f9ebc85e67
child 49743 b2da6c360225
equal deleted inserted replaced
49642:7bad9c9efdf3 49643:a3453bbd5418
    56 
    56 
    57   static G1IHOPControl* create_ihop_control(const G1Predictions* predictor);
    57   static G1IHOPControl* create_ihop_control(const G1Predictions* predictor);
    58   // Update the IHOP control with necessary statistics.
    58   // Update the IHOP control with necessary statistics.
    59   void update_ihop_prediction(double mutator_time_s,
    59   void update_ihop_prediction(double mutator_time_s,
    60                               size_t mutator_alloc_bytes,
    60                               size_t mutator_alloc_bytes,
    61                               size_t young_gen_size);
    61                               size_t young_gen_size,
       
    62                               bool this_gc_was_young_only);
    62   void report_ihop_statistics();
    63   void report_ihop_statistics();
    63 
    64 
    64   G1Predictions _predictor;
    65   G1Predictions _predictor;
    65   G1Analytics* _analytics;
    66   G1Analytics* _analytics;
    66   G1RemSetTrackingPolicy _remset_tracker;
    67   G1RemSetTrackingPolicy _remset_tracker;
   103   // The amount of allocated bytes in old gen during the last mutator and the following
   104   // The amount of allocated bytes in old gen during the last mutator and the following
   104   // young GC phase.
   105   // young GC phase.
   105   size_t _bytes_allocated_in_old_since_last_gc;
   106   size_t _bytes_allocated_in_old_since_last_gc;
   106 
   107 
   107   G1InitialMarkToMixedTimeTracker _initial_mark_to_mixed;
   108   G1InitialMarkToMixedTimeTracker _initial_mark_to_mixed;
       
   109 
       
   110   bool should_update_surv_rate_group_predictors() {
       
   111     return collector_state()->in_young_only_phase() && !collector_state()->mark_or_rebuild_in_progress();
       
   112   }
   108 public:
   113 public:
   109   const G1Predictions& predictor() const { return _predictor; }
   114   const G1Predictions& predictor() const { return _predictor; }
   110   const G1Analytics* analytics()   const { return const_cast<const G1Analytics*>(_analytics); }
   115   const G1Analytics* analytics()   const { return const_cast<const G1Analytics*>(_analytics); }
   111 
   116 
   112   G1RemSetTrackingPolicy* remset_tracker() { return &_remset_tracker; }
   117   G1RemSetTrackingPolicy* remset_tracker() { return &_remset_tracker; }
   133                                       size_t scanned_cards) const;
   138                                       size_t scanned_cards) const;
   134   size_t predict_bytes_to_copy(HeapRegion* hr) const;
   139   size_t predict_bytes_to_copy(HeapRegion* hr) const;
   135   double predict_region_elapsed_time_ms(HeapRegion* hr, bool for_young_gc) const;
   140   double predict_region_elapsed_time_ms(HeapRegion* hr, bool for_young_gc) const;
   136 
   141 
   137   double predict_survivor_regions_evac_time() const;
   142   double predict_survivor_regions_evac_time() const;
   138 
       
   139   bool should_update_surv_rate_group_predictors() {
       
   140     return collector_state()->last_gc_was_young() && !collector_state()->in_marking_window();
       
   141   }
       
   142 
   143 
   143   void cset_regions_freed() {
   144   void cset_regions_freed() {
   144     bool update = should_update_surv_rate_group_predictors();
   145     bool update = should_update_surv_rate_group_predictors();
   145 
   146 
   146     _short_lived_surv_rate_group->all_surviving_words_recorded(predictor(), update);
   147     _short_lived_surv_rate_group->all_surviving_words_recorded(predictor(), update);
   356 
   357 
   357   // This is called at the very beginning of an evacuation pause (it
   358   // This is called at the very beginning of an evacuation pause (it
   358   // has to be the first thing that the pause does). If
   359   // has to be the first thing that the pause does). If
   359   // initiate_conc_mark_if_possible() is true, and the concurrent
   360   // initiate_conc_mark_if_possible() is true, and the concurrent
   360   // marking thread has completed its work during the previous cycle,
   361   // marking thread has completed its work during the previous cycle,
   361   // it will set during_initial_mark_pause() to so that the pause does
   362   // it will set in_initial_mark_gc() to so that the pause does
   362   // the initial-mark work and start a marking cycle.
   363   // the initial-mark work and start a marking cycle.
   363   void decide_on_conc_mark_initiation();
   364   void decide_on_conc_mark_initiation();
   364 
   365 
   365   void finished_recalculating_age_indexes(bool is_survivors) {
   366   void finished_recalculating_age_indexes(bool is_survivors) {
   366     if (is_survivors) {
   367     if (is_survivors) {