The Hotspot (or JIT) compiler technology is the one which boosts the Java performance by interfacing the Java platform and the actual underlying platform. Hotspot provides comparable performance with native applications as the optimization is done on-the-fly, during runtime.
Both are implemented as separate binaries (windows: %JAVA_HOME%\bin\{client|server}; solaris & linux: $JAVA_HOME/lib/$ARCHITECTURE/{client|server}). The Java launcher (${JAVA_HOME}/bin/java[.exe]) chooses the required hotspot VM based on the command line arguments. Though there are two hotspot VMs available, a developer cannot target his Java code for a particular3 VM. Java byte-code is 100% compatible with both the hotspot VMs.
% java -client -versionA Hotspot Client VM is suitable for any short-lived applications like a Java Applet in a web browser or UI application on desktops. Client VM makes the application load faster, does few optimizations compared to Server VM, identifies a hotspot (code that is used heavily by the application which can be optimized) very sooner than the Server VM. Also it uses different set of GC (garbage collection) algorithms than the Server VM. With tiger (1.5.0), Client JVM started sharing the core classes between instances by Class Data Sharing feature. This speeds up the application startup and reduces the memory footprint. The -version output above gives the information whether the JVM is using shared classes sharing. This is not available for Server VM.
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
% java -server -versionServer VM is best suitable for all long running applications like Application Servers, Web Servers and so. This class VM does more levels optimizations enabled the server applications run faster. With a long running Java process, the amount of garbage created is also very high and proportionate to the heap size (-Xms, -Xmx). With very big heaps, the GC might need more time to clean up. To overcome such issues, Server VM comes with many GC algorithms to choose from. There is also verity of flags and command line options available to fine tune the GC.
Java HotSpot(TM) Server VM (build 1.5.0_06-b05, mixed mode)
There is also an option available to disable both the hotspot VMs. Use -Xint (interpreter mode) . Please note that this also requires any one of the hotspot VM's interpreter, if nothing is specified the default one is used.
% java -Xint -server -versionMost downloaded configurations of a JRE (Java Runtime Environment) for Windows will have only Client Hotspot VM, unless the platform does not have a client VM.
Java HotSpot(TM) Server VM (build 1.5.0_06-b05, interpreted mode)
To change the default VM, move your default choice in the file $JAVA_HOME/lib/$ARCHITECTURE/jvm.cfg to be the first uncommented line.
1. JDK has been known in many forms: JavaTM 2 Platform Standard Edition Development Kit 5.0 with '1.5.0' or 'tiger', J2SE Software Development Kit with '1.4.2' or 'mantis', Java SE Development Kit 6 (the next major release - 'mustang').