which JVM is best for Tomcat?

I have Tomcat 6.0 up and running. I went to tweak the memory sizes and realized that I have it running on the Sun JDK 1.6 client JVM. I don't have the Sun server JVM installed:

C:\>java -client -version
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)

C:\>java -server -version
Error: no `server' JVM at `C:\appl\java\jre6u16\bin\server\jvm.dll'.

To clarify: I know how to switch JVMs in Tomcat from client to server. I just have to pick the most appropriate server JVM.

Am I going to notice a big difference between client and server JVMs? If I want the Sun server JVM, do I have to reinstall the whole JDK? Are there other free server alternatives that would be good for running Tomcat?


Here (from the Sun release notes) is the answer I was looking for, at least for how to ensure the JDK server is up and running:

jre\bin\server\

On Microsoft Windows platforms, the JDK includes both the Java HotSpotTM Server VM and Java HotSpotTM Client VM. However, the JRE for Microsoft Windows platforms includes only the Java HotSpotTM Client VM. Those wishing to use the Java HotSpotTM Server VM with the JRE may copy the JDK's jre\bin\server folder to a bin\server directory in the JRE. Software vendors may redistribute the Java HotSpotTM Server VM with their redistributions of the JRE.


Have you tried to use the file setenv.sh under TOMCAT_HOME/bin/ ? You have to manually create this file (e.g via vi) and then add you Java options. For example:

cd TOMCAT_HOME/bin
vi setenv.sh

add the following line in this file:

export JAVA_OPTS='-server'

This way your JVM should run in server mode.


Yes, you probably want the server JVM. It is tuned for server-side performance. You won't know for sure unless you go to the effort of benchmarking, but I have yet to come across anyone saying that the client VM worked better for their Tomcat setup.

As far as whether you need to download the entire JDK or not -- that I don't know, unfortunately.