568 if (!survivor_overflow()) {
569 // Keep running averages on how much survived
570 size_policy->avg_survived()->sample(survived);
571 } else {
572 size_t promoted =
573 (size_t) next_gen()->gc_stats()->avg_promoted()->last_sample();
574 assert(promoted < gch->capacity(), "Conversion problem?");
575 size_t survived_guess = survived + promoted;
576 size_policy->avg_survived()->sample(survived_guess);
577 }
578
579 size_t survivor_limit = max_survivor_size();
580 _tenuring_threshold =
581 size_policy->compute_survivor_space_size_and_threshold(
582 _survivor_overflow,
583 _tenuring_threshold,
584 survivor_limit);
585 size_policy->avg_young_live()->sample(used());
586 size_policy->avg_eden_live()->sample(eden()->used());
587
588 size_policy->compute_young_generation_free_space(eden()->capacity(),
589 max_gen_size());
590
591 resize(size_policy->calculated_eden_size_in_bytes(),
592 size_policy->calculated_survivor_size_in_bytes());
593
594 if (UsePerfData) {
595 CMSGCAdaptivePolicyCounters* counters =
596 (CMSGCAdaptivePolicyCounters*) gch->collector_policy()->counters();
597 assert(counters->kind() ==
598 GCPolicyCounters::CMSGCAdaptivePolicyCountersKind,
599 "Wrong kind of counters");
600 counters->update_tenuring_threshold(_tenuring_threshold);
601 counters->update_survivor_overflowed(_survivor_overflow);
602 counters->update_young_capacity(capacity());
603 }
604 }
605
606
607 #ifndef PRODUCT
608 // Changes from PSYoungGen version
|
568 if (!survivor_overflow()) {
569 // Keep running averages on how much survived
570 size_policy->avg_survived()->sample(survived);
571 } else {
572 size_t promoted =
573 (size_t) next_gen()->gc_stats()->avg_promoted()->last_sample();
574 assert(promoted < gch->capacity(), "Conversion problem?");
575 size_t survived_guess = survived + promoted;
576 size_policy->avg_survived()->sample(survived_guess);
577 }
578
579 size_t survivor_limit = max_survivor_size();
580 _tenuring_threshold =
581 size_policy->compute_survivor_space_size_and_threshold(
582 _survivor_overflow,
583 _tenuring_threshold,
584 survivor_limit);
585 size_policy->avg_young_live()->sample(used());
586 size_policy->avg_eden_live()->sample(eden()->used());
587
588 size_policy->compute_eden_space_size(eden()->capacity(),
589 max_gen_size());
590
591 resize(size_policy->calculated_eden_size_in_bytes(),
592 size_policy->calculated_survivor_size_in_bytes());
593
594 if (UsePerfData) {
595 CMSGCAdaptivePolicyCounters* counters =
596 (CMSGCAdaptivePolicyCounters*) gch->collector_policy()->counters();
597 assert(counters->kind() ==
598 GCPolicyCounters::CMSGCAdaptivePolicyCountersKind,
599 "Wrong kind of counters");
600 counters->update_tenuring_threshold(_tenuring_threshold);
601 counters->update_survivor_overflowed(_survivor_overflow);
602 counters->update_young_capacity(capacity());
603 }
604 }
605
606
607 #ifndef PRODUCT
608 // Changes from PSYoungGen version
|