Tuesday, June 25, 2013

Java Garbage Collection Tuning

Excellent introductory article on Java Garbage Collection Tuning by Sun/Oracle. I think every Java programmer should be aware of those basics. 

Different GC algorithms (serial / parallel / concorrent-mark-sweep) are discussed here, as well as how to use Java VM options for chosing among them.

And if you pass

-Xloggc:[file] -XX:+PrintGCDetails -XX:+PrintGCDateStamp

to your VM, you can feed the resulting GC logfile to a tool like GCViewer (for support for the latest VM versions, use GCViewer from GitHub), and create results like this: