Java Chatter and Random Nagging

Wednesday, December 06, 2006

Java VM Performance

During surfing, I came accross the following articles considering Java performance :
I am not going to jump into the flameware C++ versus Java. One interesting topic however did drew my attention. Despite the opposite benchmark results of both articles, they have one result in common : the significant performance difference between client VM and server VM.

Every form of Sun's Java runtime comes with both the client VM and the server VM. Java applications and applets run by default in the client VM. Following the benchmarks, the Server VM is much faster than the Client VM, although it has the downside of taking around 10% longer to start up due to its HotSpot behavior, and it uses more memory.
To run Java applications with the server VM, use
java -server [arguments...] instead of java [arguments...]. Setting this -server parameter causes the use of an optimizing JIT compiler, due to Java HotSpot VM options.

In relation to the post Adding your development database under source control you have to modify the database server startup script as follows :

<java classname="org.hsqldb.Server" classpathref="master-classpath" fork="true">
<jvmarg value="-server"/>

If running this results in the following error :

Error: no `server' JVM at ...

you have to copy the server folder from your Java/jdk1.5.0_10/jre/bin to the Java/jre1.5.0_10/bin folder.

P.S. For the freaks who get a thrill of performance statistics, the more reliable source is the performance shootout at Computer Language Shootout.


Post a Comment

<< Home