Nishan
Nishan

Reputation: 2871

Running tomcat with -server JVM option

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.

Upvotes: 4

Views: 11527

Answers (5)

mrd081
mrd081

Reputation: 279

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

Upvotes: -2

Stephen C
Stephen C

Reputation: 719709

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.

Upvotes: 3

Denis Tulskiy
Denis Tulskiy

Reputation: 19187

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.

Upvotes: 1

Andreas Dolk
Andreas Dolk

Reputation: 114847

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

Upvotes: 2

Musannif Zahir
Musannif Zahir

Reputation: 3029

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.

Upvotes: 0

Related Questions