有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

jvm使用java服务器选项

报告说:

-server

Select the Java HotSpot Server VM. On a 64-bit capable jdk only the Java HotSpot Server VM is supported so the -server option is implicit. This is subject to change in a future release.

For default VM selection, see Server-Class Machine Detection

因为64位JDK是隐式的,所以在运行命令java时不需要添加这个参数,对吗

进一步的文档{a2}指出,服务器类机器至少有2个CPU和至少2GB的物理内存。这是否仍然正确/适用于JDK7u25

从文档中可以看出,如果将-server选项与服务器类机器一起使用,则会提高性能,我想知道还有其他特殊优势吗


共 (1) 个答案

  1. # 1 楼答案

    Since, it is implicit with 64-bit JDK, we don't need to add this argument while running command java, am I right?

    对。如果您运行的是64位JVM,那么如果用户传递了-server选项,则没有什么区别

    Further documentation here says that server-class machine is one with at least 2 CPUs and at least 2GB of physical memory. Is this still true/applies with JDK7u25?

    根据您关于64位JVM的第一句话,此标准仅用于32位运行时

    As from the documentation it is understood that it improves the performance if -server option is used with server-class machine, I would like to know is there any other specific advantage?

    正如您的第一句话所提到的,-server启用了Java热点服务器VM。这意味着JVM将进行更积极的即时(JIT)编译优化。对于非服务器类机器,这是禁用的,因为进行优化可能会使程序速度过慢,但对于现代机器,您通常有备用的内核,因此优化JIT可能会在您的程序插入时在自己的线程中停止运行