Java Garbage Collection Info and Tuning
Carol McDonald, a Java Architect at Sun, has put together a very nice set of slides on the concepts behind garbage collection (GC) in Java, how to tune your application for the best GC performance, and tools to help you further. This was part of a presentation she gave, which I unfortunately was not at.
Her blog entry is here (with lots of links):
http://blogs.sun.com/carolmcdonald/entry/java_garbage_collection_monitoring_and
Or you can find just the slides at:
http://www.slideshare.net/caroljmcdonald/java-garbage-collection-monitoring-and-tuning
Overall, the slides are very good, and cover the basics of what garbage collection is, how Java uses the concept of "generations" to speed up most collections, and how object pooling (a technique people use to "help" the GC) actually make it worse. I suggest you take a look at the slide and read further on the topic. Having the skills to tune the JVM and GC can do wonders for any Java application's performance.
References and More Information
Here are some links from Carol's slides, as well as some of my own.
Inside the G1 Garbage Collector:
-http://www.ddj.com/java/219401061
Real-time Garbage Collection:
-http://www.informit.com/store/product.aspx?isbn=0137142986
Finding Memory Leaks Using the NetBeans Profiler.Performance, Monitoring and Management, Testing, and Debugging of Java Applications:
-http://www.javapassion.com/javaperformance/
-http://netbeans.org/kb/docs/java/profiler-intro.html
-http://www.netbeans.org/community/magazine/html/04/profiler.html
Memory management white paper:
-http://java.sun.com/j2se/reference/whitepapers/
Destructors, Finalizers, and Synchronization:
-http://portal.acm.org/citation.cfm?id=604153
Memory-retention due to finalization article:
-http://www.devx.com/Java/Article/30192
Help finding bugs:
-http://findbugs.sourceforge.net
Heap analysis tools Monitoring and Management:
-http://java.sun.com/developer/technicalArticles/J2SE/monitoring/
Troubleshooting guide:
-http://java.sun.com/javase/6/webnotes/trouble/
JConsole:
-http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html
Happy coding (and garbage collecting)!
-EJB

