Tomcat on Java 6

tomcat logoSince Java 6 (a.k.a. Java 1.6) has been out for some time now, I decided to give it a try, and see how its claimed performance improvements play out in "real life".

Obviously, the most important factor in switching to Java 6 is going to be the application stability, but I was puzzled by the fact that some people have been experiencing considerable performance gains with just a JVM upgrade.

After "some testing" to ensure that our web application still functioned correctly, I too noticed a drastic change in the startup time of Tomcat (5.5.20), running our app based on Spring 2.0, Hibernate/Annotations 3.2, Acegi, etc.

On one of our test servers (Pentium 4 2.8GHz), the Tomcat startup time was cut down by half! It dropped from 40+ seconds to just 20s. On another (Xeon 2.8GHz), the startup time went from 26s to just 16s. And on my MacBook Pro (Core 2 Duo 2.33GHz), the startup time dropped from 12s to just 8.5s (using only a preview release of Java 6 for Mac OS X).

I still plan on doing a lot more testing to:
1) Validate that Tomcat/Spring/Hibernate/Acegi/our app code really function correctly on Java 6.
2) Understand how switching to Java 6 would impact the run-time performance of our app
3) Determine exactly what's allowing Java 6 to boost application startup time by such a huge margin

In case you are wondering, the JVM options for Tomcat in all these cases were just set to

-server -Xmx512m

- i.e. no GC tuning.

Our Hibernate is initialized with

hibernate.hbm2ddl.auto=update

which makes it scan some 40+ entities on startup.

What are your experiences with Java 6?

Related Marakana Courses

One Response to “Tomcat on Java 6”

  1. Delisa May Says:

    6d3q04j2vx6mp4xl

Leave a Reply