• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hotspot: java -server

 
Bill Clar
Ranch Hand
Posts: 163
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've searched through all the Hotspot threads and haven't found an answer, so forgive me if this question has been previously asked.

Currently we are running a Tomcat web application using JRE 1.4.0. The default Hotspot setting is client. Ideally, I'd like to use the -server setting, however, I'd like to know if there are any risks involved with this switch.

Will the application run slower initially?
Will the application throw any Exceptions that the -client mode previously di d not catch?

Thanks,

Bill Clar
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I understand it, the server JVM differs mainly in its eagerness to compile code to native and in its default garbage-collection strategies. The server JVM is biases towards better performance in the long run, possibly at the expense of longer start-up time.

You do not need to adjust your Java code to accommodate changing between client and server JVM. Well, not unless your code has some very nasty timing dependencies, or something.

I use server JVM for my server and client JVM for my clients, and have not found any problems with this configuration.
 
Joe Ess
Bartender
Posts: 9297
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java Platform Performance book has a chapter on the HotSpot virtual machine, explaining the differences between server and client.
 
Peter White
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the latest JVM's will auto select -server mode anyway if the machine is of sufficient spec (2CPU and 2GB RAM).

We use this setting with tomcat with no noticable difference in startup times (approx 45s inc. some cache warmups). We haven't seem anything different in exceptions, although we had a few problems on our 64bit machines initially, but the latest 1.5 JVM seems fine now.

Cheers

Peter
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as performance is concerned the server JVM is supposed to be faster than the client JVM. I remember seeing a graph that compared the performance of the client and the server JVM with C++. The server JVM was winning. I cant remember the link though.
[ September 24, 2006: Message edited by: John Meyers ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic