Saturday, October 20, 2007

Performance tuning Java

Here is a centralized location for information on performance tuning the JVM: http://java.sun.com/javase/technologies/performance.jsp.

Specifically, here is a great white paper on tuning ideas that include some great examples.

I have to admit I am rather new to this subject, but am really interested in learning more. From what I have read and also learned from my co-worker Travis Chase, the best and simplest improvement you can make is running your JVM with the -server option. Most likely your JDK came with the default -client set which starts up faster for development reasons, but should be switched to -server for better performance in production environments. However, before you start performance tuning be mindful of the Ergonomic settings which automatically set your defaults. For example for Window users (32-bit) the -client option is automatically set. Here is some more information on Ergonomics for Java 5.0.

1 comments:

Tony said...

I recently found the NetBeans IDE quite helpful with tuning a large java application that used lots of memory (2gb). The profiling tools within the IDE are excellent and the NetBeans site provided a great tutorial on getting started.

For what its worth, I don't use NetBeans on a day to day basis, I prefer IntelliJ.