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

src/share/vm/runtime/arguments.cpp

Print this page

        

*** 2072,2090 **** --- 2072,2107 ---- // If the maximum heap size has not been set with -Xmx, // then set it as fraction of the size of physical memory, // respecting the maximum and minimum sizes of the heap. if (FLAG_IS_DEFAULT(MaxHeapSize)) { julong reasonable_max = phys_mem / MaxRAMFraction; + // The percentage forms of the Initial/Min/Max RAM options override + // the deprecated fractional forms. + if (!FLAG_IS_DEFAULT(MaxRAMPercentage)) + reasonable_max = (phys_mem * MaxRAMPercentage) / 100; + if (!FLAG_IS_DEFAULT(MinRAMPercentage)) { + if (phys_mem <= ((MaxHeapSize * MinRAMPercentage) / 100)) { + // Small physical memory, so use a minimum fraction of it for the heap + reasonable_max = (phys_mem * MinRAMPercentage) / 100; + } else { + // Not-small physical memory, so require a heap at least + // as large as MaxHeapSize + reasonable_max = MAX2(reasonable_max, (julong)MaxHeapSize); + } + } else { if (phys_mem <= MaxHeapSize * MinRAMFraction) { // Small physical memory, so use a minimum fraction of it for the heap reasonable_max = phys_mem / MinRAMFraction; } else { // Not-small physical memory, so require a heap at least // as large as MaxHeapSize reasonable_max = MAX2(reasonable_max, (julong)MaxHeapSize); } + } + + if (!FLAG_IS_DEFAULT(ErgoHeapSizeLimit) && ErgoHeapSizeLimit != 0) { // Limit the heap size to ErgoHeapSizeLimit reasonable_max = MIN2(reasonable_max, (julong)ErgoHeapSizeLimit); } if (UseCompressedOops) {
*** 2134,2143 **** --- 2151,2162 ---- reasonable_minimum = limit_by_allocatable_memory(reasonable_minimum); if (InitialHeapSize == 0) { julong reasonable_initial = phys_mem / InitialRAMFraction; + if (!FLAG_IS_DEFAULT(InitialRAMPercentage)) + reasonable_initial = (phys_mem * InitialRAMPercentage) / 100; reasonable_initial = MAX3(reasonable_initial, reasonable_minimum, (julong)min_heap_size()); reasonable_initial = MIN2(reasonable_initial, (julong)MaxHeapSize); reasonable_initial = limit_by_allocatable_memory(reasonable_initial);
src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File