As a developer I often feel the need to performance tune code, or write “the best piece of code ever”. Sometimes this happens even before I know which sections of the code will be executed frequently? These days I make every attempt to hold back from this approach. In applications where performance is critical I usually write it the most natural way and apply any optimisations required later. Usually in such systems I am more worried about garbage collection / not getting a cache hit for memory, than outright CPU performance.
Recently I had a few performance problems with an application that required JVM GC monitoring. It had been so long since the last time I'd had to perform any CG analysis that I had to remind myself of what to do! Using jps and jstat to get JVM GC statistics First, ensure that an appropriate JDK is on your path [dave@titan ~]$ java -version java version "1.7.0_45" OpenJDK Runtime Environment (fedora-2.