NonStop Server for Java 5.1 Programmer's Reference

Java GC Tuning for Application Performance
The NonStop Server for Java 5.1 incorporates the HotSpot VM. This topic discusses the options available for
tuning the JVM, suggests flags and values to tune the Java HotSpot VM, and points to HotSpot tuning information
on the Internet. GC tuning is assisted by GC profile data which can be collected and analyzed as explained in the
next section.
Since GC takes place when generations fill up, the amount of available total heap memory has direct impact on the
performance. The parameters that affect the heap are listed below.
-Xms : the startup size of memory allocation pool (the GC heap)
-Xmx : the maximum memory allocation pool
The maximum value for the NonStop system depends on the location of the QIO segment. If the segment is
moved to KSEG2, the maximum value can be as high as 900 MB, otherwise, the maximum value may stay
around 350 MB. For information on QIO segment location, see Memory Considerations: Moving QIO to
KSEG2. Also, for more information on the -Xms and -Xmx options, see Managing Generation Size.
For large server applications, the default values of the two options listed are usually not adequate. In general, you
should grant as much memory to the JVM as possible.
Another important factor that affects performance is the proportion of the heap that is assigned to the young
generation. The parameters for the young-generation heap are listed below:
XX:NewRatio=nn The ratio between the young and old.
XX:NewSize=nn The lower size bound.
XX:MaxNewSize=nn The upper size bound.
XX:SurvivorRatio=nn Tune the survivor spaces (illustrated in the Layout for Generations).
For example:
java Xms512m Xmx512m XX:NewSize=256m XX:MaxNewSize=256m \
XX:SurvivorRatio=2 class
These options inform the JVM to set the initial size of the heap to 512 MB, the maximum heap to 512 MB, the new
generation to 256 MB (128 MB belongs to Eden and 2x64 MB survivor) and the old generation to 256 MB.
For details about all these parameters, see Java HotSpot VM Options
(http://java.sun.com/docs/hotspot/VMOptions.html)
For details about tuning garbage collection with the 1.5.0 Java virtual machine and for general performance tuning
information, see:
Tuning Garbage Collection with the 1.5.0 Java Virtual Machine
(http://java.sun.com/docs/hotspot/gc1.5.0/index.html)
The article Tuning Java I/O Performance
(http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/)
The article, Turbo-charging Java HotSpot Virtual Machine, v1.4.x to Improve the Performance and
Scalability of Application Servers (http://java.sun.com/developer/technicalArticles/Programming/turbo/)
Java Performance Documentation (http://java.sun.com/docs/performance/)
Note: