src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp

Print this page




 450     MIN2(eden_live, (size_t) avg_eden_live()->average());
 451   const size_t free_in_eden = max_eden_size > live_in_eden ?
 452     max_eden_size - live_in_eden : 0;
 453   const size_t free_in_old_gen = (size_t)(max_old_gen_size - avg_old_live()->average());
 454   const size_t total_free_limit = free_in_old_gen + free_in_eden;
 455   const size_t total_mem = max_old_gen_size + max_eden_size;
 456   const double mem_free_limit = total_mem * (GCHeapFreeLimit/100.0);
 457   const double mem_free_old_limit = max_old_gen_size * (GCHeapFreeLimit/100.0);
 458   const double mem_free_eden_limit = max_eden_size * (GCHeapFreeLimit/100.0);
 459   const double gc_cost_limit = GCTimeLimit/100.0;
 460   size_t promo_limit = (size_t)(max_old_gen_size - avg_old_live()->average());
 461   // But don't force a promo size below the current promo size. Otherwise,
 462   // the promo size will shrink for no good reason.
 463   promo_limit = MAX2(promo_limit, _promo_size);
 464 
 465 
 466   if (PrintAdaptiveSizePolicy && (Verbose ||
 467       (free_in_old_gen < (size_t) mem_free_old_limit &&
 468        free_in_eden < (size_t) mem_free_eden_limit))) {
 469     gclog_or_tty->print_cr(
 470           "PSAdaptiveSizePolicy::compute_generation_free_space limits:"
 471           " promo_limit: " SIZE_FORMAT
 472           " max_eden_size: " SIZE_FORMAT
 473           " total_free_limit: " SIZE_FORMAT
 474           " max_old_gen_size: " SIZE_FORMAT
 475           " max_eden_size: " SIZE_FORMAT
 476           " mem_free_limit: " SIZE_FORMAT,
 477           promo_limit, max_eden_size, total_free_limit,
 478           max_old_gen_size, max_eden_size,
 479           (size_t) mem_free_limit);
 480   }
 481 
 482   bool print_gc_overhead_limit_would_be_exceeded = false;
 483   if (is_full_gc) {
 484     if (gc_cost() > gc_cost_limit &&
 485       free_in_old_gen < (size_t) mem_free_old_limit &&
 486       free_in_eden < (size_t) mem_free_eden_limit) {
 487       // Collections, on average, are taking too much time, and
 488       //      gc_cost() > gc_cost_limit
 489       // we have too little space available after a full gc.
 490       //      total_free_limit < mem_free_limit




 450     MIN2(eden_live, (size_t) avg_eden_live()->average());
 451   const size_t free_in_eden = max_eden_size > live_in_eden ?
 452     max_eden_size - live_in_eden : 0;
 453   const size_t free_in_old_gen = (size_t)(max_old_gen_size - avg_old_live()->average());
 454   const size_t total_free_limit = free_in_old_gen + free_in_eden;
 455   const size_t total_mem = max_old_gen_size + max_eden_size;
 456   const double mem_free_limit = total_mem * (GCHeapFreeLimit/100.0);
 457   const double mem_free_old_limit = max_old_gen_size * (GCHeapFreeLimit/100.0);
 458   const double mem_free_eden_limit = max_eden_size * (GCHeapFreeLimit/100.0);
 459   const double gc_cost_limit = GCTimeLimit/100.0;
 460   size_t promo_limit = (size_t)(max_old_gen_size - avg_old_live()->average());
 461   // But don't force a promo size below the current promo size. Otherwise,
 462   // the promo size will shrink for no good reason.
 463   promo_limit = MAX2(promo_limit, _promo_size);
 464 
 465 
 466   if (PrintAdaptiveSizePolicy && (Verbose ||
 467       (free_in_old_gen < (size_t) mem_free_old_limit &&
 468        free_in_eden < (size_t) mem_free_eden_limit))) {
 469     gclog_or_tty->print_cr(
 470           "PSAdaptiveSizePolicy::compute_generations_free_space limits:"
 471           " promo_limit: " SIZE_FORMAT
 472           " max_eden_size: " SIZE_FORMAT
 473           " total_free_limit: " SIZE_FORMAT
 474           " max_old_gen_size: " SIZE_FORMAT
 475           " max_eden_size: " SIZE_FORMAT
 476           " mem_free_limit: " SIZE_FORMAT,
 477           promo_limit, max_eden_size, total_free_limit,
 478           max_old_gen_size, max_eden_size,
 479           (size_t) mem_free_limit);
 480   }
 481 
 482   bool print_gc_overhead_limit_would_be_exceeded = false;
 483   if (is_full_gc) {
 484     if (gc_cost() > gc_cost_limit &&
 485       free_in_old_gen < (size_t) mem_free_old_limit &&
 486       free_in_eden < (size_t) mem_free_eden_limit) {
 487       // Collections, on average, are taking too much time, and
 488       //      gc_cost() > gc_cost_limit
 489       // we have too little space available after a full gc.
 490       //      total_free_limit < mem_free_limit