src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/gc_implementation/concurrentMarkSweep

src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp

Print this page




 936   // compute expansion delta needed for reaching desired free percentage
 937   if (free_percentage < desired_free_percentage) {
 938     size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage));
 939     assert(desired_capacity >= capacity(), "invalid expansion size");
 940     size_t expand_bytes = MAX2(desired_capacity - capacity(), MinHeapDeltaBytes);
 941     if (PrintGCDetails && Verbose) {
 942       size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage));
 943       gclog_or_tty->print_cr("\nFrom compute_new_size: ");
 944       gclog_or_tty->print_cr("  Free fraction %f", free_percentage);
 945       gclog_or_tty->print_cr("  Desired free fraction %f",
 946         desired_free_percentage);
 947       gclog_or_tty->print_cr("  Maximum free fraction %f",
 948         maximum_free_percentage);
 949       gclog_or_tty->print_cr("  Capacity "SIZE_FORMAT, capacity()/1000);
 950       gclog_or_tty->print_cr("  Desired capacity "SIZE_FORMAT,
 951         desired_capacity/1000);
 952       int prev_level = level() - 1;
 953       if (prev_level >= 0) {
 954         size_t prev_size = 0;
 955         GenCollectedHeap* gch = GenCollectedHeap::heap();
 956         Generation* prev_gen = gch->_gens[prev_level];
 957         prev_size = prev_gen->capacity();
 958           gclog_or_tty->print_cr("  Younger gen size "SIZE_FORMAT,
 959                                  prev_size/1000);
 960       }
 961       gclog_or_tty->print_cr("  unsafe_max_alloc_nogc "SIZE_FORMAT,
 962         unsafe_max_alloc_nogc()/1000);
 963       gclog_or_tty->print_cr("  contiguous available "SIZE_FORMAT,
 964         contiguous_available()/1000);
 965       gclog_or_tty->print_cr("  Expand by "SIZE_FORMAT" (bytes)",
 966         expand_bytes);
 967     }
 968     // safe if expansion fails
 969     expand(expand_bytes, 0, CMSExpansionCause::_satisfy_free_ratio);
 970     if (PrintGCDetails && Verbose) {
 971       gclog_or_tty->print_cr("  Expanded free fraction %f",
 972         ((double) free()) / capacity());
 973     }
 974   } else {
 975     size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage));
 976     assert(desired_capacity <= capacity(), "invalid expansion size");




 936   // compute expansion delta needed for reaching desired free percentage
 937   if (free_percentage < desired_free_percentage) {
 938     size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage));
 939     assert(desired_capacity >= capacity(), "invalid expansion size");
 940     size_t expand_bytes = MAX2(desired_capacity - capacity(), MinHeapDeltaBytes);
 941     if (PrintGCDetails && Verbose) {
 942       size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage));
 943       gclog_or_tty->print_cr("\nFrom compute_new_size: ");
 944       gclog_or_tty->print_cr("  Free fraction %f", free_percentage);
 945       gclog_or_tty->print_cr("  Desired free fraction %f",
 946         desired_free_percentage);
 947       gclog_or_tty->print_cr("  Maximum free fraction %f",
 948         maximum_free_percentage);
 949       gclog_or_tty->print_cr("  Capacity "SIZE_FORMAT, capacity()/1000);
 950       gclog_or_tty->print_cr("  Desired capacity "SIZE_FORMAT,
 951         desired_capacity/1000);
 952       int prev_level = level() - 1;
 953       if (prev_level >= 0) {
 954         size_t prev_size = 0;
 955         GenCollectedHeap* gch = GenCollectedHeap::heap();
 956         Generation* prev_gen = gch->get_gen(prev_level);
 957         prev_size = prev_gen->capacity();
 958           gclog_or_tty->print_cr("  Younger gen size "SIZE_FORMAT,
 959                                  prev_size/1000);
 960       }
 961       gclog_or_tty->print_cr("  unsafe_max_alloc_nogc "SIZE_FORMAT,
 962         unsafe_max_alloc_nogc()/1000);
 963       gclog_or_tty->print_cr("  contiguous available "SIZE_FORMAT,
 964         contiguous_available()/1000);
 965       gclog_or_tty->print_cr("  Expand by "SIZE_FORMAT" (bytes)",
 966         expand_bytes);
 967     }
 968     // safe if expansion fails
 969     expand(expand_bytes, 0, CMSExpansionCause::_satisfy_free_ratio);
 970     if (PrintGCDetails && Verbose) {
 971       gclog_or_tty->print_cr("  Expanded free fraction %f",
 972         ((double) free()) / capacity());
 973     }
 974   } else {
 975     size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage));
 976     assert(desired_capacity <= capacity(), "invalid expansion size");


src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File