4

I am testing my tomcat server 4, with -server jvm option. My JDK is 1.5 on FreeBSD.

I don't see any noticable difference or any issues. If I am to turn this option on on my prod systems, what kind of improvement can I expect and what kind of issues should I lookout for?

I have read What's the effect of -server option for the HotSpot JVM?, but it does not discuss this in detail.

Community
  • 1
  • 1
Nishan
  • 2,821
  • 4
  • 27
  • 36

5 Answers5

3

It is quite possible that the JVM was already running in server mode. For JDK 5/6 on Linux, the JVM will default to server-mode on a server-class machine:

"[...] the definition of a server-class machine is one with at least 2 CPUs and at least 2GB of physical memory. "

This is documented here (and here for Java 6).

It is not spelled out what happens on FreeBsd, but I expect that it is the FreeBsd JVMs are server-mode-only or that they defaults to server-mode on a server-class machine as with Linux.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • I am on JDK 1.5. http://www.oracle.com/technetwork/java/ergo5-140223.html says that JVM by default is in server mode for server class machines since 1.5. So I need not explicitly turn it on I guess. – Nishan Apr 13 '11 at 04:55
2

The trick is that modern JVM can "autodetect" a server-like machine. So if you do not specify -server or -client, a JVM1.5+ will choose the best method - and it simply may be that it will run in server mode even if you do not use the attribute.

In that case, you may notice a difference if you start the JVM with the -client option.

Reference

Andreas Dolk
  • 113,398
  • 19
  • 180
  • 268
1

First difference that server mode does is turns on Parallel GC, it is a throughput garbage collector, recommended for multi-core machines. In general, it will give you shorter delays for garbage collection.

Second, server mode will use more aggressive optimizations in the JIT.

I think server mode is a must have on production machine.

I'd recommend you to switch to 1.6 JVM, since it has better implementations of the gc's and is better optimized.

Denis Tulskiy
  • 19,012
  • 6
  • 50
  • 68
0

The OTN website discusses the difference. We seldom use the default arguments (GC collection algorithms, heap sizes, etc.) in any of our production systems so it doesn't provide much of a boost.

There aren't any specific things you need to lookout for after implementing this argument but if you see a difference between -server and -client, the JIT compiler is always a good place to start.

Musannif Zahir
  • 3,001
  • 1
  • 21
  • 31
-2

you will notice the difference in long term due to different garbage collection and other parameters.

mrd081
  • 279
  • 2
  • 11