< prev index next >

src/share/vm/memory/tenuredGeneration.cpp

Print this page




 277 // intersect with dirty cards.
 278 void TenuredGeneration::verify_alloc_buffers_clean() {
 279   if (UseParNewGC) {
 280     for (uint i = 0; i < ParallelGCThreads; i++) {
 281       _rs->verify_aligned_region_empty(_alloc_buffers[i]->range());
 282     }
 283   }
 284 }
 285 
 286 #else  // INCLUDE_ALL_GCS
 287 void TenuredGeneration::retire_alloc_buffers_before_full_gc() {}
 288 void TenuredGeneration::verify_alloc_buffers_clean() {}
 289 #endif // INCLUDE_ALL_GCS
 290 
 291 bool TenuredGeneration::promotion_attempt_is_safe(size_t max_promotion_in_bytes) const {
 292   size_t available = max_contiguous_available();
 293   size_t av_promo  = (size_t)gc_stats()->avg_promoted()->padded_average();
 294   bool   res = (available >= av_promo) || (available >= max_promotion_in_bytes);
 295   if (PrintGC && Verbose) {
 296     gclog_or_tty->print_cr(
 297       "Tenured: promo attempt is%s safe: available("SIZE_FORMAT") %s av_promo("SIZE_FORMAT"),"
 298       "max_promo("SIZE_FORMAT")",
 299       res? "":" not", available, res? ">=":"<",
 300       av_promo, max_promotion_in_bytes);
 301   }
 302   return res;
 303 }


 277 // intersect with dirty cards.
 278 void TenuredGeneration::verify_alloc_buffers_clean() {
 279   if (UseParNewGC) {
 280     for (uint i = 0; i < ParallelGCThreads; i++) {
 281       _rs->verify_aligned_region_empty(_alloc_buffers[i]->range());
 282     }
 283   }
 284 }
 285 
 286 #else  // INCLUDE_ALL_GCS
 287 void TenuredGeneration::retire_alloc_buffers_before_full_gc() {}
 288 void TenuredGeneration::verify_alloc_buffers_clean() {}
 289 #endif // INCLUDE_ALL_GCS
 290 
 291 bool TenuredGeneration::promotion_attempt_is_safe(size_t max_promotion_in_bytes) const {
 292   size_t available = max_contiguous_available();
 293   size_t av_promo  = (size_t)gc_stats()->avg_promoted()->padded_average();
 294   bool   res = (available >= av_promo) || (available >= max_promotion_in_bytes);
 295   if (PrintGC && Verbose) {
 296     gclog_or_tty->print_cr(
 297       "Tenured: promo attempt is%s safe: available(" SIZE_FORMAT ") %s av_promo(" SIZE_FORMAT "),"
 298       "max_promo(" SIZE_FORMAT ")",
 299       res? "":" not", available, res? ">=":"<",
 300       av_promo, max_promotion_in_bytes);
 301   }
 302   return res;
 303 }
< prev index next >