8028391: Make the Min/MaxHeapFreeRatio flags manageable

Made the flags Min- and MaxHeapFreeRatio manageable, and implemented support for these flags in ParallalGC.

Reviewed-by: sla, mgerdin, brutisso
This commit is contained in:
Jesper Wilhelmsson 2014-01-29 23:17:05 +01:00
parent 9d4f3dfd4f
commit 5301534dc3
11 changed files with 178 additions and 36 deletions

View file

@ -529,8 +529,19 @@ bool PSScavenge::invoke_no_policy() {
counters->update_survivor_overflowed(_survivor_overflow);
}
size_t max_young_size = young_gen->max_size();
// Deciding a free ratio in the young generation is tricky, so if
// MinHeapFreeRatio or MaxHeapFreeRatio are in use (implicating
// that the old generation size may have been limited because of them) we
// should then limit our young generation size using NewRatio to have it
// follow the old generation size.
if (MinHeapFreeRatio != 0 || MaxHeapFreeRatio != 100) {
max_young_size = MIN2(old_gen->capacity_in_bytes() / NewRatio, young_gen->max_size());
}
size_t survivor_limit =
size_policy->max_survivor_size(young_gen->max_size());
size_policy->max_survivor_size(max_young_size);
_tenuring_threshold =
size_policy->compute_survivor_space_size_and_threshold(
_survivor_overflow,
@ -553,8 +564,7 @@ bool PSScavenge::invoke_no_policy() {
// Do call at minor collections?
// Don't check if the size_policy is ready at this
// level. Let the size_policy check that internally.
if (UseAdaptiveSizePolicy &&
UseAdaptiveGenerationSizePolicyAtMinorCollection &&
if (UseAdaptiveGenerationSizePolicyAtMinorCollection &&
((gc_cause != GCCause::_java_lang_system_gc) ||
UseAdaptiveSizePolicyWithSystemGC)) {
@ -568,7 +578,7 @@ bool PSScavenge::invoke_no_policy() {
size_t eden_live = young_gen->eden_space()->used_in_bytes();
size_t cur_eden = young_gen->eden_space()->capacity_in_bytes();
size_t max_old_gen_size = old_gen->max_gen_size();
size_t max_eden_size = young_gen->max_size() -
size_t max_eden_size = max_young_size -
young_gen->from_space()->capacity_in_bytes() -
young_gen->to_space()->capacity_in_bytes();