< prev index next >

src/share/vm/gc/parallel/psMarkSweep.cpp

Print this page




 393          old_gen->virtual_space()->alignment(), "alignments do not match");
 394 
 395   if (!(UseAdaptiveSizePolicy && UseAdaptiveGCBoundary)) {
 396     return false;
 397   }
 398 
 399   // Both generations must be completely committed.
 400   if (young_gen->virtual_space()->uncommitted_size() != 0) {
 401     return false;
 402   }
 403   if (old_gen->virtual_space()->uncommitted_size() != 0) {
 404     return false;
 405   }
 406 
 407   // Figure out how much to take from eden.  Include the average amount promoted
 408   // in the total; otherwise the next young gen GC will simply bail out to a
 409   // full GC.
 410   const size_t alignment = old_gen->virtual_space()->alignment();
 411   const size_t eden_used = eden_space->used_in_bytes();
 412   const size_t promoted = (size_t)size_policy->avg_promoted()->padded_average();
 413   const size_t absorb_size = align_size_up(eden_used + promoted, alignment);
 414   const size_t eden_capacity = eden_space->capacity_in_bytes();
 415 
 416   if (absorb_size >= eden_capacity) {
 417     return false; // Must leave some space in eden.
 418   }
 419 
 420   const size_t new_young_size = young_gen->capacity_in_bytes() - absorb_size;
 421   if (new_young_size < young_gen->min_gen_size()) {
 422     return false; // Respect young gen minimum size.
 423   }
 424 
 425   log_trace(heap, ergo)(" absorbing " SIZE_FORMAT "K:  "
 426                         "eden " SIZE_FORMAT "K->" SIZE_FORMAT "K "
 427                         "from " SIZE_FORMAT "K, to " SIZE_FORMAT "K "
 428                         "young_gen " SIZE_FORMAT "K->" SIZE_FORMAT "K ",
 429                         absorb_size / K,
 430                         eden_capacity / K, (eden_capacity - absorb_size) / K,
 431                         young_gen->from_space()->used_in_bytes() / K,
 432                         young_gen->to_space()->used_in_bytes() / K,
 433                         young_gen->capacity_in_bytes() / K, new_young_size / K);




 393          old_gen->virtual_space()->alignment(), "alignments do not match");
 394 
 395   if (!(UseAdaptiveSizePolicy && UseAdaptiveGCBoundary)) {
 396     return false;
 397   }
 398 
 399   // Both generations must be completely committed.
 400   if (young_gen->virtual_space()->uncommitted_size() != 0) {
 401     return false;
 402   }
 403   if (old_gen->virtual_space()->uncommitted_size() != 0) {
 404     return false;
 405   }
 406 
 407   // Figure out how much to take from eden.  Include the average amount promoted
 408   // in the total; otherwise the next young gen GC will simply bail out to a
 409   // full GC.
 410   const size_t alignment = old_gen->virtual_space()->alignment();
 411   const size_t eden_used = eden_space->used_in_bytes();
 412   const size_t promoted = (size_t)size_policy->avg_promoted()->padded_average();
 413   const size_t absorb_size = align_up(eden_used + promoted, alignment);
 414   const size_t eden_capacity = eden_space->capacity_in_bytes();
 415 
 416   if (absorb_size >= eden_capacity) {
 417     return false; // Must leave some space in eden.
 418   }
 419 
 420   const size_t new_young_size = young_gen->capacity_in_bytes() - absorb_size;
 421   if (new_young_size < young_gen->min_gen_size()) {
 422     return false; // Respect young gen minimum size.
 423   }
 424 
 425   log_trace(heap, ergo)(" absorbing " SIZE_FORMAT "K:  "
 426                         "eden " SIZE_FORMAT "K->" SIZE_FORMAT "K "
 427                         "from " SIZE_FORMAT "K, to " SIZE_FORMAT "K "
 428                         "young_gen " SIZE_FORMAT "K->" SIZE_FORMAT "K ",
 429                         absorb_size / K,
 430                         eden_capacity / K, (eden_capacity - absorb_size) / K,
 431                         young_gen->from_space()->used_in_bytes() / K,
 432                         young_gen->to_space()->used_in_bytes() / K,
 433                         young_gen->capacity_in_bytes() / K, new_young_size / K);


< prev index next >