417 #else // SERIALGC |
417 #else // SERIALGC |
418 void TenuredGeneration::retire_alloc_buffers_before_full_gc() {} |
418 void TenuredGeneration::retire_alloc_buffers_before_full_gc() {} |
419 void TenuredGeneration::verify_alloc_buffers_clean() {} |
419 void TenuredGeneration::verify_alloc_buffers_clean() {} |
420 #endif // SERIALGC |
420 #endif // SERIALGC |
421 |
421 |
422 bool TenuredGeneration::promotion_attempt_is_safe( |
422 bool TenuredGeneration::promotion_attempt_is_safe(size_t max_promotion_in_bytes) const { |
423 size_t max_promotion_in_bytes, |
423 size_t available = max_contiguous_available(); |
424 bool younger_handles_promotion_failure) const { |
424 size_t av_promo = (size_t)gc_stats()->avg_promoted()->padded_average(); |
425 |
425 bool res = (available >= av_promo) || (available >= max_promotion_in_bytes); |
426 bool result = max_contiguous_available() >= max_promotion_in_bytes; |
426 if (PrintGC && Verbose) { |
427 |
427 gclog_or_tty->print_cr( |
428 if (younger_handles_promotion_failure && !result) { |
428 "Tenured: promo attempt is%s safe: available("SIZE_FORMAT") %s av_promo("SIZE_FORMAT")," |
429 result = max_contiguous_available() >= |
429 "max_promo("SIZE_FORMAT")", |
430 (size_t) gc_stats()->avg_promoted()->padded_average(); |
430 res? "":" not", available, res? ">=":"<", |
431 if (PrintGC && Verbose && result) { |
431 av_promo, max_promotion_in_bytes); |
432 gclog_or_tty->print_cr("TenuredGeneration::promotion_attempt_is_safe" |
432 } |
433 " contiguous_available: " SIZE_FORMAT |
433 return res; |
434 " avg_promoted: " SIZE_FORMAT, |
434 } |
435 max_contiguous_available(), |
|
436 gc_stats()->avg_promoted()->padded_average()); |
|
437 } |
|
438 } else { |
|
439 if (PrintGC && Verbose) { |
|
440 gclog_or_tty->print_cr("TenuredGeneration::promotion_attempt_is_safe" |
|
441 " contiguous_available: " SIZE_FORMAT |
|
442 " promotion_in_bytes: " SIZE_FORMAT, |
|
443 max_contiguous_available(), max_promotion_in_bytes); |
|
444 } |
|
445 } |
|
446 return result; |
|
447 } |
|