comparison src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp @ 14726:92aa6797d639

Backed out merge changeset: b51e29501f30 Backed out merge revision to its first parent (8f483e200405)
author Doug Simon <doug.simon@oracle.com>
date Mon, 24 Mar 2014 21:30:43 +0100
parents e9ca52f59632
children
comparison
equal deleted inserted replaced
14719:0bdd0d157040 14726:92aa6797d639
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
293 // Calculate optimal free space amounts 283 // Calculate optimal free space amounts
294 assert(young_gen->max_size() > 284 assert(young_gen->max_size() >
295 young_gen->from_space()->capacity_in_bytes() + 285 young_gen->from_space()->capacity_in_bytes() +
296 young_gen->to_space()->capacity_in_bytes(), 286 young_gen->to_space()->capacity_in_bytes(),
297 "Sizes of space in young gen are out-of-bounds"); 287 "Sizes of space in young gen are out-of-bounds");
326 316
327 size_policy->decay_supplemental_growth(true /* full gc*/); 317 size_policy->decay_supplemental_growth(true /* full gc*/);
328 318
329 heap->resize_old_gen(size_policy->calculated_old_free_size_in_bytes()); 319 heap->resize_old_gen(size_policy->calculated_old_free_size_in_bytes());
330 320
331 heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(), 321 // Don't resize the young generation at an major collection. A
332 size_policy->calculated_survivor_size_in_bytes()); 322 // desired young generation size may have been calculated but
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.
333 } 327 }
334 if (PrintAdaptiveSizePolicy) { 328 if (PrintAdaptiveSizePolicy) {
335 gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ", 329 gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ",
336 heap->total_collections()); 330 heap->total_collections());
337 } 331 }