I was looking at my JDK installations and I saw a difference between two installations:
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) Client VM (build 25.121-b13, mixed mode)
vs
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) Client VM (build 25.121-b13, mixed mode, sharing)
And I was wondering what the difference between the sharing
and not sharing
state is.
I couldn't find a good answer other than "a speed difference", but no explanations why/what this is about.
The Java HotSpot Client VM The Java HotSpot Client Virtual Machine* serves as a replacement for both the "classic" virtual machine and the Just-in-time (JIT) compilers used by previous versions of the Java 2 SDK to offer improved runtime performance for applications and applets.
Mixed mode means Hotspot dynamically compiles Java bytecodes into native code when a number of criteria have been met, including the number of times the method has been run through the interpreter. Mixed runtime mode normally results in the best performance.
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. The Client VM offers improved run time performance for applications and applets.
That's called Class Data Sharing
, as described here; this only works for a Client VM
.
Basically it is a way to speed-up the start-up time of the VM - the parsed classes are stored in a file and when the VM starts, it just reads that file (with already compiled classes), it also can be shared with other running VMs.
The shared
build will contain a file jre\bin\client\classes.jsa
and the other one will not.
Since java-8 you can add your own classes to that file - if I remember correctly and the native code (not the byte code) will be there for grabs.
I have not used Client VM's with this support - just read about it.
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