
Managing Memory and Garbage Collection
memory structures. The difference between the maximum address space and the total of those values is the amount of memory that can be allocated to the heap.
You can improve performance by increasing your heap size or using a different garbage collector. In general, for
Heap Tuning Parameters
You can control the heap size with the following JVM parameters:
■-Xmsvalue
■-Xmxvalue
■
■
■
■
■
■
The
Set the values of
The NewSize and MaxNewSize parameters control the new generation’s minimum and maximum size. Regulate the new generation size by setting these parameters equal. The bigger the younger generation, the less often minor collections occur. The size of the young generation relative to the old generation is controlled by NewRatio. For example, setting
By default, the Enterprise Server is invoked with the Java HotSpot Server JVM. The default NewRatio for the Server JVM is 2: the old generation occupies 2/3 of the heap while the new generation occupies 1/3. The larger new generation can accommodate many more
To size the Java heap:
88 | Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide • January 2009 |