Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Java , running in -server mode, say that the version is "mixed-mode"?

Tags:

Why does Java , running in -server mode, say that the version is "mixed-mode" ? When I see that, does it mean that the JVM didn't truly load in pure server mode?

like image 204
djangofan Avatar asked Feb 03 '11 19:02

djangofan


People also ask

What is Openjdk mixed mode?

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.

Can I have two versions of Java installed on Windows?

It is absolutely possible to install side-by-side several JRE/JDK versions. Moreover, you don't have to do anything special for that to happen, as Sun is creating a different folder for each (under Program Files). There is no control panel to check which JRE works for each application.


1 Answers

server mode does not mean "not mixed". Those are different settings.

Mixed does mean that the JVM will mix compiled and interpreted code. You could optionally switch to fully interpreted mode with the switch -Xint (usually you don't want to do this).

Server mode means that the hot-spot-compiler will run with server-settings. The general assumption is that VMs in server-mode are long-running, so optimizations will be done with this in mind.

So if you see mixed mode, that is no sign that your VM is not running in server-mode.

EDIT: If you want to check what is really running, try the output of

System.out.println(System.getProperty("java.vm.name")); System.out.println(System.getProperty("java.vm.info")); 

At least for the Sun VM or OpenJDK this will give you a hint. You might notice that you'll always run the Server VM if you are on a 64 bit system.

like image 87
Boris Avatar answered Sep 24 '22 13:09

Boris