Tuning the Garbage Collector
Tuning suggestion for virtual machines with large heaps using caching:
java ... -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC
-XX:NewSize=<1/4 of total heap size> -XX:SurvivorRatio=16
Note that it is better to use -XX:+DisableExplicitGC, instead of calling System.gc(). It also helps to use the low pause collector -XX:+UseConcMarkSweepGC.