Table 1: JVM Options to Be Checked for GC Tuning.
Classification | Option | Description |
Heap area size | -Xms | Heap area size when starting JVM |
-Xmx | Maximum heap area size | |
New area size | -XX:NewRatio | Ratio of New area and Old area |
-XX:NewSize | New area size | |
-XX:SurvivorRatio | Ratio 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).