
Managing Memory and Garbage Collection
■Decide the total amount of memory you can afford for the JVM. Accordingly, graph your own performance metric against young generation sizes to find the best setting.
■Make plenty of memory available to the young generation. The default is calculated from NewRatio and the
■Larger eden or younger generation spaces increase the spacing between full GCs. But young space collections could take a proportionally longer time. In general, keep the eden size between one fourth and one third the maximum heap size. The old generation must be larger than the new generation.
For
EXAMPLE 4–1 Heap Configuration on Solaris
This is an exmple heap configuration used by Enterprise Server on Solaris for large applications:
Survivor Ratio Sizing
The SurvivorRatio parameter controls the size of the two survivor spaces. For example,
Use the option
Rebasing DLLs on Windows
When the JVM initializes, it tries to allocate its heap using the
Chapter 4 • Tuning the Java Runtime System | 89 |