What is JVM -server parameter?
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开发者_如何学JAVA it work? Can we use this parameter for java desktop application?
thanks.
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
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
You can check this blog for additional info: http://victorpillac.wordpress.com/2011/09/11/notes-on-the-java-server-flag/
Basically on most recent machines different from 32bits windows the flag will be turned on by default. For 32bits windows you will need to download the JDK to get the server system.
More info on server vms : http://download.oracle.com/javase/1.3/docs/guide/performance/hotspot.html#server
精彩评论