57 class PSAdaptiveSizePolicy : public AdaptiveSizePolicy {
58 friend class PSGCAdaptivePolicyCounters;
59 private:
60 // These values are used to record decisions made during the
61 // policy. For example, if the young generation was decreased
62 // to decrease the GC cost of minor collections the value
63 // decrease_young_gen_for_throughput_true is used.
64
65 // Last calculated sizes, in bytes, and aligned
66 // NEEDS_CLEANUP should use sizes.hpp, but it works in ints, not size_t's
67
68 // Time statistics
69 AdaptivePaddedAverage* _avg_major_pause;
70
71 // Footprint statistics
72 AdaptiveWeightedAverage* _avg_base_footprint;
73
74 // Statistical data gathered for GC
75 GCStats _gc_stats;
76
77 size_t _survivor_size_limit; // Limit in bytes of survivor size
78 const double _collection_cost_margin_fraction;
79
80 // Variable for estimating the major and minor pause times.
81 // These variables represent linear least-squares fits of
82 // the data.
83 // major pause time vs. old gen size
84 LinearLeastSquareFit* _major_pause_old_estimator;
85 // major pause time vs. young gen size
86 LinearLeastSquareFit* _major_pause_young_estimator;
87
88
89 // These record the most recent collection times. They
90 // are available as an alternative to using the averages
91 // for making ergonomic decisions.
92 double _latest_major_mutator_interval_seconds;
93
94 const size_t _space_alignment; // alignment for eden, survivors
95
96 const double _gc_minor_pause_goal_sec; // goal for maximum minor gc pause
97
98 // The amount of live data in the heap at the last full GC, used
99 // as a baseline to help us determine when we need to perform the
100 // next full GC.
101 size_t _live_at_last_full_gc;
102
103 // decrease/increase the old generation for minor pause time
104 int _change_old_gen_for_min_pauses;
105
106 // increase/decrease the young generation for major pause time
107 int _change_young_gen_for_maj_pauses;
108
109
110 // Flag indicating that the adaptive policy is ready to use
111 bool _old_gen_policy_is_ready;
112
113 // Changing the generation sizing depends on the data that is
114 // gathered about the effects of changes on the pause times and
115 // throughput. These variable count the number of data points
116 // gathered. The policy may use these counters as a threshold
117 // for reliable data.
118 julong _young_gen_change_for_major_pause_count;
119
120 // To facilitate faster growth at start up, supplement the normal
121 // growth percentage for the young gen eden and the
122 // old gen space for promotion with these value which decay
123 // with increasing collections.
124 uint _young_gen_size_increment_supplement;
125 uint _old_gen_size_increment_supplement;
126
127 // The number of bytes absorbed from eden into the old gen by moving the
128 // boundary over live data.
129 size_t _bytes_absorbed_from_eden;
130
131 private:
132
133 // Accessors
134 AdaptivePaddedAverage* avg_major_pause() const { return _avg_major_pause; }
135 double gc_minor_pause_goal_sec() const { return _gc_minor_pause_goal_sec; }
136
137 void adjust_eden_for_minor_pause_time(bool is_full_gc,
|
57 class PSAdaptiveSizePolicy : public AdaptiveSizePolicy {
58 friend class PSGCAdaptivePolicyCounters;
59 private:
60 // These values are used to record decisions made during the
61 // policy. For example, if the young generation was decreased
62 // to decrease the GC cost of minor collections the value
63 // decrease_young_gen_for_throughput_true is used.
64
65 // Last calculated sizes, in bytes, and aligned
66 // NEEDS_CLEANUP should use sizes.hpp, but it works in ints, not size_t's
67
68 // Time statistics
69 AdaptivePaddedAverage* _avg_major_pause;
70
71 // Footprint statistics
72 AdaptiveWeightedAverage* _avg_base_footprint;
73
74 // Statistical data gathered for GC
75 GCStats _gc_stats;
76
77 const double _collection_cost_margin_fraction;
78
79 // Variable for estimating the major and minor pause times.
80 // These variables represent linear least-squares fits of
81 // the data.
82 // major pause time vs. old gen size
83 LinearLeastSquareFit* _major_pause_old_estimator;
84 // major pause time vs. young gen size
85 LinearLeastSquareFit* _major_pause_young_estimator;
86
87
88 // These record the most recent collection times. They
89 // are available as an alternative to using the averages
90 // for making ergonomic decisions.
91 double _latest_major_mutator_interval_seconds;
92
93 const size_t _space_alignment; // alignment for eden, survivors
94
95 const double _gc_minor_pause_goal_sec; // goal for maximum minor gc pause
96
97 // The amount of live data in the heap at the last full GC, used
98 // as a baseline to help us determine when we need to perform the
99 // next full GC.
100 size_t _live_at_last_full_gc;
101
102 // decrease/increase the old generation for minor pause time
103 int _change_old_gen_for_min_pauses;
104
105 // increase/decrease the young generation for major pause time
106 int _change_young_gen_for_maj_pauses;
107
108
109 // Flag indicating that the adaptive policy is ready to use
110 bool _old_gen_policy_is_ready;
111
112 // To facilitate faster growth at start up, supplement the normal
113 // growth percentage for the young gen eden and the
114 // old gen space for promotion with these value which decay
115 // with increasing collections.
116 uint _young_gen_size_increment_supplement;
117 uint _old_gen_size_increment_supplement;
118
119 // The number of bytes absorbed from eden into the old gen by moving the
120 // boundary over live data.
121 size_t _bytes_absorbed_from_eden;
122
123 private:
124
125 // Accessors
126 AdaptivePaddedAverage* avg_major_pause() const { return _avg_major_pause; }
127 double gc_minor_pause_goal_sec() const { return _gc_minor_pause_goal_sec; }
128
129 void adjust_eden_for_minor_pause_time(bool is_full_gc,
|