src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp

Print this page




 263                        heap->total_collections());
 264         if (Verbose) {
 265           gclog_or_tty->print("old_gen_capacity: %d young_gen_capacity: %d",
 266             old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes());
 267         }
 268       }
 269 
 270       // Don't check if the size_policy is ready here.  Let
 271       // the size_policy check that internally.
 272       if (UseAdaptiveGenerationSizePolicyAtMajorCollection &&
 273           ((gc_cause != GCCause::_java_lang_system_gc) ||
 274             UseAdaptiveSizePolicyWithSystemGC)) {
 275         // Calculate optimal free space amounts
 276         assert(young_gen->max_size() >
 277           young_gen->from_space()->capacity_in_bytes() +
 278           young_gen->to_space()->capacity_in_bytes(),
 279           "Sizes of space in young gen are out-of-bounds");
 280         size_t max_eden_size = young_gen->max_size() -
 281           young_gen->from_space()->capacity_in_bytes() -
 282           young_gen->to_space()->capacity_in_bytes();
 283         size_policy->compute_generation_free_space(young_gen->used_in_bytes(),
 284                                  young_gen->eden_space()->used_in_bytes(),
 285                                  old_gen->used_in_bytes(),
 286                                  young_gen->eden_space()->capacity_in_bytes(),
 287                                  old_gen->max_gen_size(),
 288                                  max_eden_size,
 289                                  true /* full gc*/,
 290                                  gc_cause,
 291                                  heap->collector_policy());
 292 
 293         heap->resize_old_gen(size_policy->calculated_old_free_size_in_bytes());
 294 
 295         // Don't resize the young generation at an major collection.  A
 296         // desired young generation size may have been calculated but
 297         // resizing the young generation complicates the code because the
 298         // resizing of the old generation may have moved the boundary
 299         // between the young generation and the old generation.  Let the
 300         // young generation resizing happen at the minor collections.
 301       }
 302       if (PrintAdaptiveSizePolicy) {
 303         gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ",




 263                        heap->total_collections());
 264         if (Verbose) {
 265           gclog_or_tty->print("old_gen_capacity: %d young_gen_capacity: %d",
 266             old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes());
 267         }
 268       }
 269 
 270       // Don't check if the size_policy is ready here.  Let
 271       // the size_policy check that internally.
 272       if (UseAdaptiveGenerationSizePolicyAtMajorCollection &&
 273           ((gc_cause != GCCause::_java_lang_system_gc) ||
 274             UseAdaptiveSizePolicyWithSystemGC)) {
 275         // Calculate optimal free space amounts
 276         assert(young_gen->max_size() >
 277           young_gen->from_space()->capacity_in_bytes() +
 278           young_gen->to_space()->capacity_in_bytes(),
 279           "Sizes of space in young gen are out-of-bounds");
 280         size_t max_eden_size = young_gen->max_size() -
 281           young_gen->from_space()->capacity_in_bytes() -
 282           young_gen->to_space()->capacity_in_bytes();
 283         size_policy->compute_generations_free_space(young_gen->used_in_bytes(),
 284                                  young_gen->eden_space()->used_in_bytes(),
 285                                  old_gen->used_in_bytes(),
 286                                  young_gen->eden_space()->capacity_in_bytes(),
 287                                  old_gen->max_gen_size(),
 288                                  max_eden_size,
 289                                  true /* full gc*/,
 290                                  gc_cause,
 291                                  heap->collector_policy());
 292 
 293         heap->resize_old_gen(size_policy->calculated_old_free_size_in_bytes());
 294 
 295         // Don't resize the young generation at an major collection.  A
 296         // desired young generation size may have been calculated but
 297         // resizing the young generation complicates the code because the
 298         // resizing of the old generation may have moved the boundary
 299         // between the young generation and the old generation.  Let the
 300         // young generation resizing happen at the minor collections.
 301       }
 302       if (PrintAdaptiveSizePolicy) {
 303         gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ",