< prev index next >

src/hotspot/share/gc/parallel/psMarkSweep.cpp

Print this page
rev 52961 : 8212206: Refactor AdaptiveSizePolicy to separate out code related to GC overhead
Summary: Move check_gc_overhead_limit() and related code to its own class
Reviewed-by:


 299         size_t young_live = young_gen->used_in_bytes();
 300         size_t eden_live = young_gen->eden_space()->used_in_bytes();
 301         size_t old_live = old_gen->used_in_bytes();
 302         size_t cur_eden = young_gen->eden_space()->capacity_in_bytes();
 303         size_t max_old_gen_size = old_gen->max_gen_size();
 304         size_t max_eden_size = young_gen->max_size() -
 305           young_gen->from_space()->capacity_in_bytes() -
 306           young_gen->to_space()->capacity_in_bytes();
 307 
 308         // Used for diagnostics
 309         size_policy->clear_generation_free_space_flags();
 310 
 311         size_policy->compute_generations_free_space(young_live,
 312                                                     eden_live,
 313                                                     old_live,
 314                                                     cur_eden,
 315                                                     max_old_gen_size,
 316                                                     max_eden_size,
 317                                                     true /* full gc*/);
 318 
 319         size_policy->check_gc_overhead_limit(young_live,
 320                                              eden_live,
 321                                              max_old_gen_size,
 322                                              max_eden_size,
 323                                              true /* full gc*/,
 324                                              gc_cause,
 325                                              heap->soft_ref_policy());
 326 
 327         size_policy->decay_supplemental_growth(true /* full gc*/);
 328 
 329         heap->resize_old_gen(size_policy->calculated_old_free_size_in_bytes());
 330 
 331         heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(),
 332                                size_policy->calculated_survivor_size_in_bytes());
 333       }
 334       log_debug(gc, ergo)("AdaptiveSizeStop: collection: %d ", heap->total_collections());
 335     }
 336 
 337     if (UsePerfData) {
 338       heap->gc_policy_counters()->update_counters();
 339       heap->gc_policy_counters()->update_old_capacity(
 340         old_gen->capacity_in_bytes());




 299         size_t young_live = young_gen->used_in_bytes();
 300         size_t eden_live = young_gen->eden_space()->used_in_bytes();
 301         size_t old_live = old_gen->used_in_bytes();
 302         size_t cur_eden = young_gen->eden_space()->capacity_in_bytes();
 303         size_t max_old_gen_size = old_gen->max_gen_size();
 304         size_t max_eden_size = young_gen->max_size() -
 305           young_gen->from_space()->capacity_in_bytes() -
 306           young_gen->to_space()->capacity_in_bytes();
 307 
 308         // Used for diagnostics
 309         size_policy->clear_generation_free_space_flags();
 310 
 311         size_policy->compute_generations_free_space(young_live,
 312                                                     eden_live,
 313                                                     old_live,
 314                                                     cur_eden,
 315                                                     max_old_gen_size,
 316                                                     max_eden_size,
 317                                                     true /* full gc*/);
 318 
 319         size_policy->check_gc_overhead_limit(eden_live,

 320                                              max_old_gen_size,
 321                                              max_eden_size,
 322                                              true /* full gc*/,
 323                                              gc_cause,
 324                                              heap->soft_ref_policy());
 325 
 326         size_policy->decay_supplemental_growth(true /* full gc*/);
 327 
 328         heap->resize_old_gen(size_policy->calculated_old_free_size_in_bytes());
 329 
 330         heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(),
 331                                size_policy->calculated_survivor_size_in_bytes());
 332       }
 333       log_debug(gc, ergo)("AdaptiveSizeStop: collection: %d ", heap->total_collections());
 334     }
 335 
 336     if (UsePerfData) {
 337       heap->gc_policy_counters()->update_counters();
 338       heap->gc_policy_counters()->update_old_capacity(
 339         old_gen->capacity_in_bytes());


< prev index next >