< prev index next >

src/hotspot/share/gc/shared/adaptiveSizePolicy.cpp

8221260: Initialize more class members on construction, remove some unused ones
Reviewed-by:

30 
31 elapsedTimer AdaptiveSizePolicy::_minor_timer;                                                                             
32 elapsedTimer AdaptiveSizePolicy::_major_timer;                                                                             
33 
34 // The throughput goal is implemented as                                                                                   
35 //      _throughput_goal = 1 - ( 1 / (1 + gc_cost_ratio))                                                                  
36 // gc_cost_ratio is the ratio                                                                                              
37 //      application cost / gc cost                                                                                         
38 // For example a gc_cost_ratio of 4 translates into a                                                                      
39 // throughput goal of .80                                                                                                  
40 
41 AdaptiveSizePolicy::AdaptiveSizePolicy(size_t init_eden_size,                                                              
42                                        size_t init_promo_size,                                                             
43                                        size_t init_survivor_size,                                                          
44                                        double gc_pause_goal_sec,                                                           
45                                        uint gc_cost_ratio) :                                                               
46     _throughput_goal(1.0 - double(1.0 / (1.0 + (double) gc_cost_ratio))),                                                  
47     _eden_size(init_eden_size),                                                                                            
48     _promo_size(init_promo_size),                                                                                          
49     _survivor_size(init_survivor_size),                                                                                    
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
50     _latest_minor_mutator_interval_seconds(0),                                                                             
51     _threshold_tolerance_percent(1.0 + ThresholdTolerance/100.0),                                                          
52     _gc_pause_goal_sec(gc_pause_goal_sec),                                                                                 
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
53     _young_gen_change_for_minor_throughput(0),                                                                             
54     _old_gen_change_for_major_throughput(0) {                                                                              
55   _avg_minor_pause    =                                                                                                    
56     new AdaptivePaddedAverage(AdaptiveTimeWeight, PausePadding);                                                           
57   _avg_minor_interval = new AdaptiveWeightedAverage(AdaptiveTimeWeight);                                                   
58   _avg_minor_gc_cost  = new AdaptiveWeightedAverage(AdaptiveTimeWeight);                                                   
59   _avg_major_gc_cost  = new AdaptiveWeightedAverage(AdaptiveTimeWeight);                                                   
60                                                                                                                            
61   _avg_young_live     = new AdaptiveWeightedAverage(AdaptiveSizePolicyWeight);                                             
62   _avg_old_live       = new AdaptiveWeightedAverage(AdaptiveSizePolicyWeight);                                             
63   _avg_eden_live      = new AdaptiveWeightedAverage(AdaptiveSizePolicyWeight);                                             
64                                                                                                                            
65   _avg_survived       = new AdaptivePaddedAverage(AdaptiveSizePolicyWeight,                                                
66                                                   SurvivorPadding);                                                        
67   _avg_pretenured     = new AdaptivePaddedNoZeroDevAverage(                                                                
68                                                   AdaptiveSizePolicyWeight,                                                
69                                                   SurvivorPadding);                                                        
70                                                                                                                            
71   _minor_pause_old_estimator =                                                                                             
72     new LinearLeastSquareFit(AdaptiveSizePolicyWeight);                                                                    
73   _minor_pause_young_estimator =                                                                                           
74     new LinearLeastSquareFit(AdaptiveSizePolicyWeight);                                                                    
75   _minor_collection_estimator =                                                                                            
76     new LinearLeastSquareFit(AdaptiveSizePolicyWeight);                                                                    
77   _major_collection_estimator =                                                                                            
78     new LinearLeastSquareFit(AdaptiveSizePolicyWeight);                                                                    
79 
80   // Start the timers                                                                                                      
81   _minor_timer.start();                                                                                                    
82                                                                                                                            
83   _young_gen_policy_is_ready = false;                                                                                      
84 }                                                                                                                          
85 
86 bool AdaptiveSizePolicy::tenuring_threshold_change() const {                                                               
87   return decrement_tenuring_threshold_for_gc_cost() ||                                                                     
88          increment_tenuring_threshold_for_gc_cost() ||                                                                     
89          decrement_tenuring_threshold_for_survivor_limit();                                                                
90 }                                                                                                                          
91 
92 void AdaptiveSizePolicy::minor_collection_begin() {                                                                        
93   // Update the interval time                                                                                              
94   _minor_timer.stop();                                                                                                     
95   // Save most recent collection time                                                                                      
96   _latest_minor_mutator_interval_seconds = _minor_timer.seconds();                                                         
97   _minor_timer.reset();                                                                                                    
98   _minor_timer.start();                                                                                                    
99 }                                                                                                                          
100 
101 void AdaptiveSizePolicy::update_minor_pause_young_estimator(                                                               
102     double minor_pause_in_ms) {                                                                                            

30 
31 elapsedTimer AdaptiveSizePolicy::_minor_timer;
32 elapsedTimer AdaptiveSizePolicy::_major_timer;
33 
34 // The throughput goal is implemented as
35 //      _throughput_goal = 1 - ( 1 / (1 + gc_cost_ratio))
36 // gc_cost_ratio is the ratio
37 //      application cost / gc cost
38 // For example a gc_cost_ratio of 4 translates into a
39 // throughput goal of .80
40 
41 AdaptiveSizePolicy::AdaptiveSizePolicy(size_t init_eden_size,
42                                        size_t init_promo_size,
43                                        size_t init_survivor_size,
44                                        double gc_pause_goal_sec,
45                                        uint gc_cost_ratio) :
46     _throughput_goal(1.0 - double(1.0 / (1.0 + (double) gc_cost_ratio))),
47     _eden_size(init_eden_size),
48     _promo_size(init_promo_size),
49     _survivor_size(init_survivor_size),
50     _avg_minor_pause(new AdaptivePaddedAverage(AdaptiveTimeWeight, PausePadding)),
51     _avg_minor_interval(new AdaptiveWeightedAverage(AdaptiveTimeWeight)),
52     _avg_minor_gc_cost(new AdaptiveWeightedAverage(AdaptiveTimeWeight)),
53     _avg_major_interval(new AdaptiveWeightedAverage(AdaptiveTimeWeight)),
54     _avg_major_gc_cost(new AdaptiveWeightedAverage(AdaptiveTimeWeight)),
55     _avg_young_live(new AdaptiveWeightedAverage(AdaptiveSizePolicyWeight)),
56     _avg_eden_live(new AdaptiveWeightedAverage(AdaptiveSizePolicyWeight)),
57     _avg_old_live(new AdaptiveWeightedAverage(AdaptiveSizePolicyWeight)),
58     _avg_survived(new AdaptivePaddedAverage(AdaptiveSizePolicyWeight, SurvivorPadding)),
59     _avg_pretenured(new AdaptivePaddedNoZeroDevAverage(AdaptiveSizePolicyWeight, SurvivorPadding)),
60     _minor_pause_old_estimator(new LinearLeastSquareFit(AdaptiveSizePolicyWeight)),
61     _minor_pause_young_estimator(new LinearLeastSquareFit(AdaptiveSizePolicyWeight)),
62     _minor_collection_estimator(new LinearLeastSquareFit(AdaptiveSizePolicyWeight)),
63     _major_collection_estimator(new LinearLeastSquareFit(AdaptiveSizePolicyWeight)),
64     _latest_minor_mutator_interval_seconds(0),
65     _threshold_tolerance_percent(1.0 + ThresholdTolerance/100.0),
66     _gc_pause_goal_sec(gc_pause_goal_sec),
67     _young_gen_policy_is_ready(false),
68     _change_young_gen_for_min_pauses(0),
69     _change_old_gen_for_maj_pauses(0),
70     _change_old_gen_for_throughput(0),
71     _change_young_gen_for_throughput(0),
72     _increment_tenuring_threshold_for_gc_cost(false),
73     _decrement_tenuring_threshold_for_gc_cost(false),
74     _decrement_tenuring_threshold_for_survivor_limit(false),
75     _decrease_for_footprint(0),
76     _decide_at_full_gc(0),
77     _young_gen_change_for_minor_throughput(0),
78     _old_gen_change_for_major_throughput(0) {
























79 
80   // Start the timers
81   _minor_timer.start();


82 }
83 
84 bool AdaptiveSizePolicy::tenuring_threshold_change() const {
85   return decrement_tenuring_threshold_for_gc_cost() ||
86          increment_tenuring_threshold_for_gc_cost() ||
87          decrement_tenuring_threshold_for_survivor_limit();
88 }
89 
90 void AdaptiveSizePolicy::minor_collection_begin() {
91   // Update the interval time
92   _minor_timer.stop();
93   // Save most recent collection time
94   _latest_minor_mutator_interval_seconds = _minor_timer.seconds();
95   _minor_timer.reset();
96   _minor_timer.start();
97 }
98 
99 void AdaptiveSizePolicy::update_minor_pause_young_estimator(
100     double minor_pause_in_ms) {
< prev index next >