Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 778
Nishan Avatar asked Nov 04 '25 08:11

Nishan


2 Answers

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.

like image 166
Stephen C Avatar answered Nov 06 '25 21:11

Stephen C


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

  • Server-Class Machine Detection
like image 40
Andreas Dolk Avatar answered Nov 06 '25 21:11

Andreas Dolk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!