255 // Let the size policy know we're done
256 size_policy->major_collection_end(old_gen->used_in_bytes(), gc_cause);
257
258 if (UseAdaptiveSizePolicy) {
259
260 if (PrintAdaptiveSizePolicy) {
261 gclog_or_tty->print("AdaptiveSizeStart: ");
262 gclog_or_tty->stamp();
263 gclog_or_tty->print_cr(" collection: %d ",
264 heap->total_collections());
265 if (Verbose) {
266 gclog_or_tty->print("old_gen_capacity: " SIZE_FORMAT
267 " young_gen_capacity: " SIZE_FORMAT,
268 old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes());
269 }
270 }
271
272 // Don't check if the size_policy is ready here. Let
273 // the size_policy check that internally.
274 if (UseAdaptiveGenerationSizePolicyAtMajorCollection &&
275 ((gc_cause != GCCause::_java_lang_system_gc) ||
276 UseAdaptiveSizePolicyWithSystemGC)) {
277 // Swap the survivor spaces if from_space is empty. The
278 // resize_young_gen() called below is normally used after
279 // a successful young GC and swapping of survivor spaces;
280 // otherwise, it will fail to resize the young gen with
281 // the current implementation.
282 if (young_gen->from_space()->is_empty()) {
283 young_gen->from_space()->clear(SpaceDecorator::Mangle);
284 young_gen->swap_spaces();
285 }
286
287 // Calculate optimal free space amounts
288 assert(young_gen->max_size() >
289 young_gen->from_space()->capacity_in_bytes() +
290 young_gen->to_space()->capacity_in_bytes(),
291 "Sizes of space in young gen are out-of-bounds");
292
293 size_t young_live = young_gen->used_in_bytes();
294 size_t eden_live = young_gen->eden_space()->used_in_bytes();
295 size_t old_live = old_gen->used_in_bytes();
296 size_t cur_eden = young_gen->eden_space()->capacity_in_bytes();
|
255 // Let the size policy know we're done
256 size_policy->major_collection_end(old_gen->used_in_bytes(), gc_cause);
257
258 if (UseAdaptiveSizePolicy) {
259
260 if (PrintAdaptiveSizePolicy) {
261 gclog_or_tty->print("AdaptiveSizeStart: ");
262 gclog_or_tty->stamp();
263 gclog_or_tty->print_cr(" collection: %d ",
264 heap->total_collections());
265 if (Verbose) {
266 gclog_or_tty->print("old_gen_capacity: " SIZE_FORMAT
267 " young_gen_capacity: " SIZE_FORMAT,
268 old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes());
269 }
270 }
271
272 // Don't check if the size_policy is ready here. Let
273 // the size_policy check that internally.
274 if (UseAdaptiveGenerationSizePolicyAtMajorCollection &&
275 AdaptiveSizePolicy::should_update_promo_stats(gc_cause)) {
276 // Swap the survivor spaces if from_space is empty. The
277 // resize_young_gen() called below is normally used after
278 // a successful young GC and swapping of survivor spaces;
279 // otherwise, it will fail to resize the young gen with
280 // the current implementation.
281 if (young_gen->from_space()->is_empty()) {
282 young_gen->from_space()->clear(SpaceDecorator::Mangle);
283 young_gen->swap_spaces();
284 }
285
286 // Calculate optimal free space amounts
287 assert(young_gen->max_size() >
288 young_gen->from_space()->capacity_in_bytes() +
289 young_gen->to_space()->capacity_in_bytes(),
290 "Sizes of space in young gen are out-of-bounds");
291
292 size_t young_live = young_gen->used_in_bytes();
293 size_t eden_live = young_gen->eden_space()->used_in_bytes();
294 size_t old_live = old_gen->used_in_bytes();
295 size_t cur_eden = young_gen->eden_space()->capacity_in_bytes();
|