Hi,
It depends upon the size of your application. For big application where there are many threads running you need to do gc optimization. For most of the application using the default garbage collector will be ok.
Try giving memory to your virtual machine. you can set -Xms and -Xmx.
According to the number of processors increase the memory .
cheers