430 }
431 }
432
433 // Let the size policy know we're done. Note that we count promotion
434 // failure cleanup time as part of the collection (otherwise, we're
435 // implicitly saying it's mutator time).
436 size_policy->minor_collection_end(gc_cause);
437
438 if (!promotion_failure_occurred) {
439 // Swap the survivor spaces.
440
441
442 young_gen->eden_space()->clear(SpaceDecorator::Mangle);
443 young_gen->from_space()->clear(SpaceDecorator::Mangle);
444 young_gen->swap_spaces();
445
446 size_t survived = young_gen->from_space()->used_in_bytes();
447 size_t promoted = old_gen->used_in_bytes() - old_gen_used_before;
448 size_policy->update_averages(_survivor_overflow, survived, promoted);
449
450 if (UseAdaptiveSizePolicy) {
451 // Calculate the new survivor size and tenuring threshold
452
453 if (PrintAdaptiveSizePolicy) {
454 gclog_or_tty->print("AdaptiveSizeStart: ");
455 gclog_or_tty->stamp();
456 gclog_or_tty->print_cr(" collection: %d ",
457 heap->total_collections());
458
459 if (Verbose) {
460 gclog_or_tty->print("old_gen_capacity: %d young_gen_capacity: %d"
461 " perm_gen_capacity: %d ",
462 old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes(),
463 perm_gen->capacity_in_bytes());
464 }
465 }
466
467
468 if (UsePerfData) {
469 PSGCAdaptivePolicyCounters* counters = heap->gc_policy_counters();
470 counters->update_old_eden_size(
|
430 }
431 }
432
433 // Let the size policy know we're done. Note that we count promotion
434 // failure cleanup time as part of the collection (otherwise, we're
435 // implicitly saying it's mutator time).
436 size_policy->minor_collection_end(gc_cause);
437
438 if (!promotion_failure_occurred) {
439 // Swap the survivor spaces.
440
441
442 young_gen->eden_space()->clear(SpaceDecorator::Mangle);
443 young_gen->from_space()->clear(SpaceDecorator::Mangle);
444 young_gen->swap_spaces();
445
446 size_t survived = young_gen->from_space()->used_in_bytes();
447 size_t promoted = old_gen->used_in_bytes() - old_gen_used_before;
448 size_policy->update_averages(_survivor_overflow, survived, promoted);
449
450 bool free_ratio_in_effect = false;
451 if ((UseFreeRatioForParallelGC ||
452 (UseFreeRatioOnlyInSystemGCForParallelGC &&
453 gc_cause == GCCause::_java_lang_system_gc))) {
454 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
455 free_ratio_in_effect = heap->try_to_shrink_by_free_ratio(false);
456 }
457
458 if (!free_ratio_in_effect && UseAdaptiveSizePolicy) {
459 // Calculate the new survivor size and tenuring threshold
460
461 if (PrintAdaptiveSizePolicy) {
462 gclog_or_tty->print("AdaptiveSizeStart: ");
463 gclog_or_tty->stamp();
464 gclog_or_tty->print_cr(" collection: %d ",
465 heap->total_collections());
466
467 if (Verbose) {
468 gclog_or_tty->print("old_gen_capacity: %d young_gen_capacity: %d"
469 " perm_gen_capacity: %d ",
470 old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes(),
471 perm_gen->capacity_in_bytes());
472 }
473 }
474
475
476 if (UsePerfData) {
477 PSGCAdaptivePolicyCounters* counters = heap->gc_policy_counters();
478 counters->update_old_eden_size(
|