Possible Duplicate:
Has anyone found Garbage Collection tuning to be useful?
Does it really help? Isn't the jvm written by much smarter people? What will be case to tune it manually?
Possible Duplicate:
Has anyone found Garbage Collection tuning to be useful?
Does it really help? Isn't the jvm written by much smarter people? What will be case to tune it manually?
Until dynamically ergonomic systems and instrumentation APIs exist (hello IBM & Oracle? you know my email, let's talk), the JVM is still limited as a machine to a set amount of size at startup. A 64 mebibyte heap won't work for a large JBoss application, and there's no reason to have an 8 gibibyte heap for a calculation.
Additionally, JVMs offer a few different GC schemes as to not have one-size-fits-all.
I tune all of my operational JVMs by analyzing the GC logs. You tune your Linux kernels yes?
The JVM is well writen, but no universall GC policy exists for every situation. Check this:
http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html
Tuning garbage collection will help your application performance when garbage collection is the bottle neck for your application. You can use the JVM command line argument -verbose:gc
to help diagnose the issue.
For most applications, I would say that out of the box garbage collection should be sufficient. If you are having performance problems I would reevaluate your code.