comparison src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp @ 14699:e9ca52f59632

7098155: Resize young gen at full collections for UseParallelGC Reviewed-by: tschatzl
author jmasa
date Wed, 05 Mar 2014 07:34:35 -0800
parents 63a4eb8bcd23
children 92aa6797d639
comparison
equal deleted inserted replaced
14697:bac9ef65b71d 14699:e9ca52f59632
278 // Don't check if the size_policy is ready here. Let 278 // Don't check if the size_policy is ready here. Let
279 // the size_policy check that internally. 279 // the size_policy check that internally.
280 if (UseAdaptiveGenerationSizePolicyAtMajorCollection && 280 if (UseAdaptiveGenerationSizePolicyAtMajorCollection &&
281 ((gc_cause != GCCause::_java_lang_system_gc) || 281 ((gc_cause != GCCause::_java_lang_system_gc) ||
282 UseAdaptiveSizePolicyWithSystemGC)) { 282 UseAdaptiveSizePolicyWithSystemGC)) {
283 // Swap the survivor spaces if from_space is empty. The
284 // resize_young_gen() called below is normally used after
285 // a successful young GC and swapping of survivor spaces;
286 // otherwise, it will fail to resize the young gen with
287 // the current implementation.
288 if (young_gen->from_space()->is_empty()) {
289 young_gen->from_space()->clear(SpaceDecorator::Mangle);
290 young_gen->swap_spaces();
291 }
292
283 // Calculate optimal free space amounts 293 // Calculate optimal free space amounts
284 assert(young_gen->max_size() > 294 assert(young_gen->max_size() >
285 young_gen->from_space()->capacity_in_bytes() + 295 young_gen->from_space()->capacity_in_bytes() +
286 young_gen->to_space()->capacity_in_bytes(), 296 young_gen->to_space()->capacity_in_bytes(),
287 "Sizes of space in young gen are out-of-bounds"); 297 "Sizes of space in young gen are out-of-bounds");
316 326
317 size_policy->decay_supplemental_growth(true /* full gc*/); 327 size_policy->decay_supplemental_growth(true /* full gc*/);
318 328
319 heap->resize_old_gen(size_policy->calculated_old_free_size_in_bytes()); 329 heap->resize_old_gen(size_policy->calculated_old_free_size_in_bytes());
320 330
321 // Don't resize the young generation at an major collection. A 331 heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(),
322 // desired young generation size may have been calculated but 332 size_policy->calculated_survivor_size_in_bytes());
323 // resizing the young generation complicates the code because the
324 // resizing of the old generation may have moved the boundary
325 // between the young generation and the old generation. Let the
326 // young generation resizing happen at the minor collections.
327 } 333 }
328 if (PrintAdaptiveSizePolicy) { 334 if (PrintAdaptiveSizePolicy) {
329 gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ", 335 gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ",
330 heap->total_collections()); 336 heap->total_collections());
331 } 337 }