src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/runtime

src/share/vm/runtime/arguments.cpp

Print this page




1744 
1745   // Preferred young gen size for "short" pauses:
1746   // upper bound depends on # of threads and NewRatio.
1747   const size_t preferred_max_new_size_unaligned =
1748     MIN2(max_heap/(NewRatio+1), ScaleForWordSize(young_gen_per_worker * ParallelGCThreads));
1749   size_t preferred_max_new_size =
1750     align_size_up(preferred_max_new_size_unaligned, os::vm_page_size());
1751 
1752   // Unless explicitly requested otherwise, size young gen
1753   // for "short" pauses ~ CMSYoungGenPerWorker*ParallelGCThreads
1754 
1755   // If either MaxNewSize or NewRatio is set on the command line,
1756   // assume the user is trying to set the size of the young gen.
1757   if (FLAG_IS_DEFAULT(MaxNewSize) && FLAG_IS_DEFAULT(NewRatio)) {
1758 
1759     // Set MaxNewSize to our calculated preferred_max_new_size unless
1760     // NewSize was set on the command line and it is larger than
1761     // preferred_max_new_size.
1762     if (!FLAG_IS_DEFAULT(NewSize)) {   // NewSize explicitly set at command-line
1763       FLAG_SET_ERGO(size_t, MaxNewSize, MAX2(NewSize, preferred_max_new_size));
1764     } else {
1765       FLAG_SET_ERGO(size_t, MaxNewSize, preferred_max_new_size);
1766     }
1767     log_trace(gc, heap)("CMS ergo set MaxNewSize: " SIZE_FORMAT, MaxNewSize);

1768 
1769     // Code along this path potentially sets NewSize and OldSize
1770     log_trace(gc, heap)("CMS set min_heap_size: " SIZE_FORMAT " initial_heap_size:  " SIZE_FORMAT " max_heap: " SIZE_FORMAT,
1771                         min_heap_size(), InitialHeapSize, max_heap);
1772     size_t min_new = preferred_max_new_size;
1773     if (FLAG_IS_CMDLINE(NewSize)) {
1774       min_new = NewSize;
1775     }
1776     if (max_heap > min_new && min_heap_size() > min_new) {
1777       // Unless explicitly requested otherwise, make young gen
1778       // at least min_new, and at most preferred_max_new_size.
1779       if (FLAG_IS_DEFAULT(NewSize)) {
1780         FLAG_SET_ERGO(size_t, NewSize, MAX2(NewSize, min_new));
1781         FLAG_SET_ERGO(size_t, NewSize, MIN2(preferred_max_new_size, NewSize));
1782         log_trace(gc, heap)("CMS ergo set NewSize: " SIZE_FORMAT, NewSize);
1783       }
1784       // Unless explicitly requested otherwise, size old gen
1785       // so it's NewRatio x of NewSize.
1786       if (FLAG_IS_DEFAULT(OldSize)) {
1787         if (max_heap > NewSize) {




1744 
1745   // Preferred young gen size for "short" pauses:
1746   // upper bound depends on # of threads and NewRatio.
1747   const size_t preferred_max_new_size_unaligned =
1748     MIN2(max_heap/(NewRatio+1), ScaleForWordSize(young_gen_per_worker * ParallelGCThreads));
1749   size_t preferred_max_new_size =
1750     align_size_up(preferred_max_new_size_unaligned, os::vm_page_size());
1751 
1752   // Unless explicitly requested otherwise, size young gen
1753   // for "short" pauses ~ CMSYoungGenPerWorker*ParallelGCThreads
1754 
1755   // If either MaxNewSize or NewRatio is set on the command line,
1756   // assume the user is trying to set the size of the young gen.
1757   if (FLAG_IS_DEFAULT(MaxNewSize) && FLAG_IS_DEFAULT(NewRatio)) {
1758 
1759     // Set MaxNewSize to our calculated preferred_max_new_size unless
1760     // NewSize was set on the command line and it is larger than
1761     // preferred_max_new_size.
1762     if (!FLAG_IS_DEFAULT(NewSize)) {   // NewSize explicitly set at command-line
1763       FLAG_SET_ERGO(size_t, MaxNewSize, MAX2(NewSize, preferred_max_new_size));



1764       log_trace(gc, heap)("CMS ergo set MaxNewSize: " SIZE_FORMAT, MaxNewSize);
1765     }
1766 
1767     // Code along this path potentially sets NewSize and OldSize
1768     log_trace(gc, heap)("CMS set min_heap_size: " SIZE_FORMAT " initial_heap_size:  " SIZE_FORMAT " max_heap: " SIZE_FORMAT,
1769                         min_heap_size(), InitialHeapSize, max_heap);
1770     size_t min_new = preferred_max_new_size;
1771     if (FLAG_IS_CMDLINE(NewSize)) {
1772       min_new = NewSize;
1773     }
1774     if (max_heap > min_new && min_heap_size() > min_new) {
1775       // Unless explicitly requested otherwise, make young gen
1776       // at least min_new, and at most preferred_max_new_size.
1777       if (FLAG_IS_DEFAULT(NewSize)) {
1778         FLAG_SET_ERGO(size_t, NewSize, MAX2(NewSize, min_new));
1779         FLAG_SET_ERGO(size_t, NewSize, MIN2(preferred_max_new_size, NewSize));
1780         log_trace(gc, heap)("CMS ergo set NewSize: " SIZE_FORMAT, NewSize);
1781       }
1782       // Unless explicitly requested otherwise, size old gen
1783       // so it's NewRatio x of NewSize.
1784       if (FLAG_IS_DEFAULT(OldSize)) {
1785         if (max_heap > NewSize) {


src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File