Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is JVM -server parameter?

Tags:

java

jvm

I saw Java -server in http://shootout.alioth.debian.org/ for programming language benchmark. I know that -server is a parameter for running JVM. I want to know:

When we use -server parameter and how it work? Can we use this parameter for java desktop application?

thanks.

like image 737
Saeed Zarinfam Avatar asked Mar 11 '11 12:03

Saeed Zarinfam


People also ask

Where are JVM parameters set?

You can change the parameters passed to the JVM in the Arguments tab in the VM Arguments box. That configuration can then be used as the default when running the project.

What is JVM used for?

Java Virtual Machine, or JVM, loads, verifies and executes Java bytecode. It is known as the interpreter or the core of Java programming language because it executes Java programming.

What are the 3 components of JVM?

The JVM consists of three distinct components: Class Loader. Runtime Memory/Data Area. Execution Engine.

What are JVM options?

There are three types of options that you can add to your JVM, standard, non-standard and advanced options. If you apply an advanced option, you always precede the option with -XX: . Similarly if you're using a non-standard option, you'll use -X . Standard options don't prepend anything to the option.


2 Answers

It just selects the "Server Hotspot VM". See documentation (Solaris/Linux) for java.

According to Wikipedia:

Sun's JRE features 2 virtual machines, one called Client and the other Server. The Client version is tuned for quick loading. It makes use of interpretation, compiling only often-run methods. The Server version loads more slowly, putting more effort into producing highly optimized JIT compilations, that yield higher performance.

See: http://en.wikipedia.org/wiki/HotSpot

like image 75
payne Avatar answered Sep 22 '22 22:09

payne


The -server flag will indicate to the launcher that the hw is a server class machine which for java 6 means at least 2 cores and at least 2 GB physical memory (ie most machines these days). On server class machines the deafult selection is

  • The throughput gc.
  • initial heap size of 1/64th of phys mem up to 1 GB
  • maximum heap size of 1/4th of phys mem up to max of 1 GB.
  • The server run time compiler.

Note that on 32 bit windows there is no server vm so the client vm is the default. On the other 32 bit machines the server vm is chosen if the hw is server class, otherwise it's client. On 64 bit machines there is no client vm so the server vm is the default.

A link to the hot spot faq: HotSpot

like image 34
Erik Avatar answered Sep 19 '22 22:09

Erik