223
224 // Input arguments are initial free space sizes for young and old
225 // generations, the initial survivor space size, the
226 // alignment values and the pause & throughput goals.
227 //
228 // NEEDS_CLEANUP this is a singleton object
229 PSAdaptiveSizePolicy(size_t init_eden_size,
230 size_t init_promo_size,
231 size_t init_survivor_size,
232 size_t space_alignment,
233 double gc_pause_goal_sec,
234 double gc_minor_pause_goal_sec,
235 uint gc_time_ratio);
236
237 // Methods indicating events of interest to the adaptive size policy,
238 // called by GC algorithms. It is the responsibility of users of this
239 // policy to call these methods at the correct times!
240 void major_collection_begin();
241 void major_collection_end(size_t amount_live, GCCause::Cause gc_cause);
242
243 //
244 void tenured_allocation(size_t size) {
245 _avg_pretenured->sample(size);
246 }
247
248 // Accessors
249 // NEEDS_CLEANUP should use sizes.hpp
250
251 size_t calculated_old_free_size_in_bytes() const {
252 return (size_t)(_promo_size + avg_promoted()->padded_average());
253 }
254
255 size_t average_old_live_in_bytes() const {
256 return (size_t) avg_old_live()->average();
257 }
258
259 size_t average_promoted_in_bytes() const {
260 return (size_t)avg_promoted()->average();
261 }
262
263 size_t padded_average_promoted_in_bytes() const {
264 return (size_t)avg_promoted()->padded_average();
265 }
266
267 int change_young_gen_for_maj_pauses() {
268 return _change_young_gen_for_maj_pauses;
269 }
270 void set_change_young_gen_for_maj_pauses(int v) {
271 _change_young_gen_for_maj_pauses = v;
272 }
273
|
223
224 // Input arguments are initial free space sizes for young and old
225 // generations, the initial survivor space size, the
226 // alignment values and the pause & throughput goals.
227 //
228 // NEEDS_CLEANUP this is a singleton object
229 PSAdaptiveSizePolicy(size_t init_eden_size,
230 size_t init_promo_size,
231 size_t init_survivor_size,
232 size_t space_alignment,
233 double gc_pause_goal_sec,
234 double gc_minor_pause_goal_sec,
235 uint gc_time_ratio);
236
237 // Methods indicating events of interest to the adaptive size policy,
238 // called by GC algorithms. It is the responsibility of users of this
239 // policy to call these methods at the correct times!
240 void major_collection_begin();
241 void major_collection_end(size_t amount_live, GCCause::Cause gc_cause);
242
243 void tenured_allocation(size_t size) {
244 _avg_pretenured->sample(size);
245 }
246
247 // Accessors
248 // NEEDS_CLEANUP should use sizes.hpp
249
250 static size_t calculate_free_based_on_live(size_t live, uintx ratio_as_percentage);
251
252 size_t calculated_old_free_size_in_bytes() const;
253
254 size_t average_old_live_in_bytes() const {
255 return (size_t) avg_old_live()->average();
256 }
257
258 size_t average_promoted_in_bytes() const {
259 return (size_t)avg_promoted()->average();
260 }
261
262 size_t padded_average_promoted_in_bytes() const {
263 return (size_t)avg_promoted()->padded_average();
264 }
265
266 int change_young_gen_for_maj_pauses() {
267 return _change_young_gen_for_maj_pauses;
268 }
269 void set_change_young_gen_for_maj_pauses(int v) {
270 _change_young_gen_for_maj_pauses = v;
271 }
272
|