Java GC


Table 1: JVM Options to Be Checked for GC Tuning.
ClassificationOptionDescription
Heap area size-XmsHeap area size when starting JVM
-XmxMaximum heap area size
New area size-XX:NewRatioRatio of New area and Old area
-XX:NewSizeNew area size
-XX:SurvivorRatioRatio of Eden area and Survivor area
I frequently use -Xms-Xmx, and -XX:NewRatio options for GC tuning.  -Xms and -Xmx option are particularly required. How you set the NewRatio option makes a significant difference on GC performance.
Some people ask how to set the Perm area size? You can set the Perm area size with the-XX:PermSize and -XX:MaxPermSize options but only when OutOfMemoryError occurs and the cause is the Perm area size.
Another option that may affect the GC performance is the GC type. The following table shows available options by GC type (based on JDK 6.0).