Meaningless Drivel is fun!
The moose likes Java in General and the fly likes Java Hotspot VM...when to use server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java Hotspot VM...when to use server" Watch "Java Hotspot VM...when to use server" New topic

Java Hotspot VM...when to use server

David Miranda
Ranch Hand

Joined: Mar 14, 2005
Posts: 34

I've come across this Java VM performance article...

It pretty much has performance metrics for many different JVMs (including other languages like Visual C++).

Anyways, they have metrics for the Java/Sun JDK 1.5.0 Client and Server VM.

The server VM performance seems significantly better than client VM (looks like server is twice as fast)...and it appears anyone can switch from client to server by simply adding the "-server" in the java call (correct me if Im wrong here).

My question is...why ever use the client when the server's performance seems to be so much better?


Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

Benchmarking Java VMs is jhard, and comparisons no less so. Take the two VMs you've mentioned here. The client is optimized for faster startup, making it nice for desktop use. It also has a larger threshold for performing HotSpot optimization tricks -- in other words, it spends more CPU time running your code, and less time speculatively compiling it. These are good choices for programs that are to be launched, run for a short time, and quit, like a desktop app, and aren't likely to be CPU-bound. The server VM, in contrast, starts up slower and spends more time doing runtime optimizations, which pays off in the long run on a server. Now, does a single speed number make sense in light of all this? No, not really.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: Java Hotspot VM...when to use server
It's not a secret anymore!