The help menu for java
command says that -server
option is to select the "server" VM. It also states that 'server' is the default option. Why so redundant?
edit:
If it is of any help, "java -version" yields:
java version "1.8.0_191"
Java(TM) SE Runtime Environment (buil 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
-client
and -server
are ignored on modern JVMs, as easy as that. There are two JIT
compilers C1
and C2
, but there are 5 tiers, all the details in the entire glory are here in the comments.
These flags used to control how C1
and C2
would act - disable or not; this is now controlled by two other flags : XX:-TieredCompilation
-XX:TieredStopAtLevel=1
I don't know your java version, IMHO, in java8 or older versions, for different platforms(different architecture and OS, or even different cup cores and memory), there are different default JVM(server or client).
This picture is taken from https://docs.oracle.com/javase/8/docs/technotes/guides/vm/server-class.html, we can see the situation for java6.
(Note: For Java SE 6, the definition of a server-class machine is one with at least 2 CPUs and at least 2GB of physical memory. )
Update:
I can only confirm that these options are also provided by java8(1.8.0_121). Not sure for java9 or later.
The -server
mode might be default in most JVM versions but there are exceptions. As per Where do I get the server and client systems? docs:
Client and server systems are both downloaded with the 32-bit Solaris and Linux downloads. For 32-bit Windows, if you download the JRE, you get only the client, you'll need to download the SDK to get both systems.
For 64-bit, only the server system is included. On Solaris, the 64-bit JRE is an overlay on top of the 32-bit distribution. However, on Linux and Windows, it's a completely separate distribution.
At the end of the day you can use -client
to switch back to client mode and sacrifice JIT optimization for faster startup time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With