They are essentially two different compilers (JITs) interfacing to the same runtime system. The -client and -server systems are different binaries. This will also let you monitor, in real time, heap and permgen space usage along with lots of other stats. This is useful if you have users who or modules which set JAVA_OPTS or use scripts which change command line options. Remember too that you can see all the details of a running jvm using jvisualvm. Recent versions of the jvm have removed flags and re-moved many of the distinctions between server and client. These values can change for different combinations of architecture, operating system and jvm version however. So with -server most of the memory limits and initial allocations are much higher for this java version. For instance, on my Linux system, I get: $ java -XX:+PrintFlagsFinal -version 2>&1 | grep -i -E 'heapsize|permsize|version' The most visible immediate difference in older versions of Java would be the memory allocated to a -client as opposed to a -server application. The Sun/Oracle 64 builds did not even ship with a client JVM. Even the cheapest computers you can find, are “server class” machines. Which explains why almost everything uses -server for quite some time now. Other systems checked whether the machine was “server class” which was fulfilled when having at least 2 cores and at least 2GiB of memory. Only on 32 bit Windows systems, -client was ever chosen unconditionally. Demecki points out in the comments that in 64-bit versions of JDK, the -client option is ignored for many years.Ī 64-bit capable JDK currently ignores this option and instead uses the Java Hotspot Server VM.Ģ022: Holger references in the comments the JavaSE6 / Server-Class Machine Detection, adding: Note: The release of jdk6 update 10 (see Update Release Notes:Changes in 1.6.0_10) tried to improve startup time, but for a different reason than the hotspot options, being packaged differently with a much smaller kernel. Adaptive optimization technology is very flexible in its approach, and typically outperforms even advanced static analysis and compilation techniques. This is a competitive and performance advantage over static compilers. The Server VM contains an advanced adaptive compiler that supports many of the same types of optimizations performed by optimizing C++ compilers, as well as some optimizations that cannot be done by traditional compilers, such as aggressive inlining across virtual method invocations. This means the Client VM can start up faster and requires a smaller memory footprint. The Client VM compiler does not try to execute many of the more complex optimizations performed by the compiler in the Server VM, but in exchange, it requires less time to analyze and compile a piece of code. So the real difference is also on the compiler level: In general, the client system is better for GUIs. The Java HotSpot Client VM has been specially tuned to reduce application start-up time and memory footprint, making it particularly well suited for client environments. The Client VM offers improved run time performance for applications and applets. The Client VM compiler serves as an upgrade for both the Classic VM and the just-in-time (JIT) compilers used by previous versions of the JDK. It is intended for executing long-running server applications, which need the fastest possible operating speed more than a fast start-up time or smaller runtime memory footprint. These differences include the compilation inlining policy and heap defaults.Īlthough the Server and the Client VMs are similar, the Server VM has been specially tuned to maximize peak operating speed. These two solutions share the Java HotSpot runtime environment code base, but use different compilers that are suited to the distinctly unique performance characteristics of clients and servers. The JDK includes two flavors of the VM - a client-side offering, and a VM tuned for server applications. This is really linked to HotSpot and the default option values ( Java HotSpot VM Options) which differ between client and server configuration.įrom Chapter 2 of the whitepaper ( The Java HotSpot Performance Engine Architecture):
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |