SUGGESTED FIX
Extend server class heap sizing to the client with a few changes.
Server heap sizing ergonomics should be unaffected.
1. NewRatio is set to 2 for all platforms to accomodate an increase in transient data size.
2. SurvivorRatio is set to 8 for all platforms. It was 8 for every platform except 64-bit x86 (where it was 6) in any case, so it isn't a big change.
3. MaxTenuringThreshold is left at 15 (the maximum).
4. Add MaxRAM, whose implemented definition matches the current comment for DefaultMaxRAM in globals.hpp. MaxRAM is the maximum physical memory size used to compute MaxHeapSize rather than the maximum possible value of MaxHeapSize set by ergonomics. Replace DefaultMaxRAM with ErgoHeapSizeLimit for the latter purpose. Add support for a new argument type, uint64_t, and used it as the type of MaxRAM. uintx doesn't have the necessary range on 32-bit systems: a user might want to specify 4g for MaxRAM on a 32-bit system.
One result of this change is that when using the 32-bit vm on 64-bit systems with more than 4gb of physical memory, the initial committed size of the heap is smaller than it would be under the old ergo. The old ergo used as the initial committed size min(physical-memory/64, maxheapsize). The new ergo uses min(min(physical-memory, MaxRAM)/64, MaxHeapSize)). This is a feature because it avoids overcommitment of memory in cases where the vm is short-lived or doesn't turn out to actually require the memory.
5. The other Default* switches have been stripped of the "Default" prefix, since to their values are just as much "default" values as the values of any of other vm switch, and those don't have a "Default" prefix. DefaultMaxRAMFraction is left as a synonym for MaxRAMFraction for the moment because QA uses it. When they change to MaxRAMFraction, DefaultMaxRAMFraction will be removed.
6. In arguments.cpp, set_heap_size() replaces set_server_heap_size() and is used for everything except CMS. CMS has it's own, incompatible, heap sizing ergonomics. An rfe will be filed to integrate CMS and the new default heap sizing ergo.
7. The minimum committed size of the old gen (OldSize) remains at 4m and the minimum committed size of the young gen (NewSize) increases to 4m. Note that these are the minimum, not initial sizes. NewSize is made common to all platforms.
8. Add a switch InitialHeapSize that can be used to set the initial committed size of the heap. Absent specification by InitialHeapSize, the initial committed size is max(1/64th of physical memory, OldSize + NewSize).
9. The default MaxHeapSize is raised from 64m to 96m. For systems with <= MaxHeapSize * MinRAMFraction of physical memory, the minimum heap size is 1/MinRAMFraction of physical memory. The default value of MinRAMFraction is 2. Thus, a 256m box gets a 96m heap, a 128m box gets a 64m heap, a 96m box gets a 48m heap and a 64m box gets a 32m heap. The default values of MaxRAM and MaxRAMFraction bound the maximum heap size to 256m for the client vms,
1g for 32-bit server vms and 32g for 64-bit server vms. The values for the server vms are the same as before. 256m is good for client because we want to bound resource utilization on client systems. Also, benchmarks runs showed no extra benefit from going to 512m heaps. 512m is the safe maximum for the serial collector.
|