2077 heap->total_collections());
2078 if (Verbose) {
2079 gclog_or_tty->print("old_gen_capacity: %d young_gen_capacity: %d",
2080 old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes());
2081 }
2082 }
2083
2084 // Don't check if the size_policy is ready here. Let
2085 // the size_policy check that internally.
2086 if (UseAdaptiveGenerationSizePolicyAtMajorCollection &&
2087 ((gc_cause != GCCause::_java_lang_system_gc) ||
2088 UseAdaptiveSizePolicyWithSystemGC)) {
2089 // Calculate optimal free space amounts
2090 assert(young_gen->max_size() >
2091 young_gen->from_space()->capacity_in_bytes() +
2092 young_gen->to_space()->capacity_in_bytes(),
2093 "Sizes of space in young gen are out-of-bounds");
2094 size_t max_eden_size = young_gen->max_size() -
2095 young_gen->from_space()->capacity_in_bytes() -
2096 young_gen->to_space()->capacity_in_bytes();
2097 size_policy->compute_generation_free_space(
2098 young_gen->used_in_bytes(),
2099 young_gen->eden_space()->used_in_bytes(),
2100 old_gen->used_in_bytes(),
2101 young_gen->eden_space()->capacity_in_bytes(),
2102 old_gen->max_gen_size(),
2103 max_eden_size,
2104 true /* full gc*/,
2105 gc_cause,
2106 heap->collector_policy());
2107
2108 heap->resize_old_gen(
2109 size_policy->calculated_old_free_size_in_bytes());
2110
2111 // Don't resize the young generation at an major collection. A
2112 // desired young generation size may have been calculated but
2113 // resizing the young generation complicates the code because the
2114 // resizing of the old generation may have moved the boundary
2115 // between the young generation and the old generation. Let the
2116 // young generation resizing happen at the minor collections.
2117 }
|
2077 heap->total_collections());
2078 if (Verbose) {
2079 gclog_or_tty->print("old_gen_capacity: %d young_gen_capacity: %d",
2080 old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes());
2081 }
2082 }
2083
2084 // Don't check if the size_policy is ready here. Let
2085 // the size_policy check that internally.
2086 if (UseAdaptiveGenerationSizePolicyAtMajorCollection &&
2087 ((gc_cause != GCCause::_java_lang_system_gc) ||
2088 UseAdaptiveSizePolicyWithSystemGC)) {
2089 // Calculate optimal free space amounts
2090 assert(young_gen->max_size() >
2091 young_gen->from_space()->capacity_in_bytes() +
2092 young_gen->to_space()->capacity_in_bytes(),
2093 "Sizes of space in young gen are out-of-bounds");
2094 size_t max_eden_size = young_gen->max_size() -
2095 young_gen->from_space()->capacity_in_bytes() -
2096 young_gen->to_space()->capacity_in_bytes();
2097 size_policy->compute_generations_free_space(
2098 young_gen->used_in_bytes(),
2099 young_gen->eden_space()->used_in_bytes(),
2100 old_gen->used_in_bytes(),
2101 young_gen->eden_space()->capacity_in_bytes(),
2102 old_gen->max_gen_size(),
2103 max_eden_size,
2104 true /* full gc*/,
2105 gc_cause,
2106 heap->collector_policy());
2107
2108 heap->resize_old_gen(
2109 size_policy->calculated_old_free_size_in_bytes());
2110
2111 // Don't resize the young generation at an major collection. A
2112 // desired young generation size may have been calculated but
2113 // resizing the young generation complicates the code because the
2114 // resizing of the old generation may have moved the boundary
2115 // between the young generation and the old generation. Let the
2116 // young generation resizing happen at the minor collections.
2117 }
|