为什么在 -server 模式下运行的 Java 说版本是混合模式"?当我看到时,这是否意味着 JVM 并没有真正以纯服务器模式加载?
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?
服务器模式并不意味着不混合".这些是不同的设置.
server mode does not mean "not mixed". Those are different settings.
混合确实意味着 JVM 将混合编译和解释代码.您可以选择使用开关 -Xint 切换到完全解释模式(通常您不想这样做).
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.
因此,如果您看到混合模式,这并不表明您的 VM 未在服务器模式下运行.
So if you see mixed mode, that is no sign that your VM is not running in server-mode.
如果您想检查真正运行的内容,请尝试
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"));
至少对于 Sun VM 或 OpenJDK,这会给您一个提示.您可能会注意到,如果您在 64 位系统上,您将始终运行服务器 VM.
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.
这篇关于为什么在 -server 模式下运行的 Java 说版本是“混合模式"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!