Why Server If It’s Not a Server?

DZone 's Guide to

Why Server If It’s Not a Server?

Learn why Server VM is sometimes used, how it determines which JIT compiler and GC are used at runtime by default, and how this affects speed.

· Performance Zone ·
Free Resource

Have you ever wondered why, when you type java -version, you usually get something like this:

java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Why Server VM?

For JVM, some machines are considered to be “client-class” and some are “server-class.” If the given machine is classified as “server-class,” then HotSpot Server VM will be used. For “client-class,” it’s going to be HotSpot Client VM. The type of HotSpot determines which type of JIT compiler and which GC will be used at runtime by default. Because of that, the Server VM starts up more slowly than the Client VM, but over time, runs more quickly.

To check whether the machine is a “client-class” or a “server-class,” you can have a look at the following (a little bit simplified) rules:

CPU with one core

CPU with multiple cores

32-bit JVM on Windows

client client

32-bit JVM on non-Windows system

client server

64-bit JVM on any system

server server
jvm ,performance ,hotspot ,compiler ,gc

Published at DZone with permission of Grzegorz Mirek , DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}