This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Hotspot VM...when to use server

 
David Miranda
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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

http://www.shudo.net/jit/perf/

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?

Thanks,

David
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic