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

2

28

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?

Selfcommand answered 3/2, 2011 at 19:59 Comment(1)
You might also want to read this: #199077Seafood
T
38

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.

Tilly answered 3/2, 2011 at 20:11 Comment(1)
-Xcomp for copmiled only. And you don't want to do that. / Incidentally, Server HotSpot has it's own interpreter (it takes profiling information, which makes it a bit slower than the bog standard interpret).Saddlebacked
C
10

Hotspot Virtual Machine

Both the client and server Hotspot compilers are included in the Java Runtime Environment.

By default the client compiler is enabled, but for intense server-side applications, you can run the server compiler with the -server runtime option. The Hotspot virtual machine normally runs in a mixed mode, as seen in the -version output. 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.

Checkpoint answered 3/2, 2011 at 20:4 Comment(2)
This actually suggests that the -server option disables mixed mode. The article is from 2000 so it's probably also not all that accurate.Chlodwig
mixed mode not neccesarily indicate server mode.Swats

© 2022 - 2024 — McMap. All rights reserved.