使用java -server选项 [英] Use of java -server option

查看:146
本文介绍了使用java -server选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Oracle文档说:


-server

-server

选择Java HotSpot Server VM。在支持64位的jdk上,仅支持
Java HotSpot Server VM,因此-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.

对于默认VM选择,请参阅服务器级机器检测

For default VM selection, see Server-Class Machine Detection

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

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

进一步的文档这里说服务器级机器是一个至少有2个CPU和至少2GB物理内存的机器。这是否仍然适用于JDK7u25?

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?

从文档中可以看出,如果-server选项与服务器级机器一起使用,它会提高性能,我会想知道还有其他什么特别的优势吗?

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?

推荐答案


因为它隐含着64-在运行命令java时我们不需要添加这个参数,我是对吗?

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 选项,则没有任何区别。

Correct. If you're running a 64-bit JVM then it makes no difference if the user passed the -server option.

这里的进一步文档说服务器级机器是一个至少有2个CPU和至少2GB物理内存的机器。这是否仍然适用于JDK7u25?

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位运行时。

In light of your first quote about 64-bit JVMs, this criteria would only be used for 32-bit runtimes.


从文档中可以看出,如果-server选项与server-class一起使用,它可以提高性能机器,我想知道还有其他特定的优势吗?

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 HotSpot Server VM 。这意味着JVM将进行更积极的即时(JIT)编译优化。这对于非服务器级机器是禁用的,因为进行优化可能会使程序运行速度过快,但是对于现代机器,您通常需要备用内核,因此优化JIT可能会在程序插入时在其自己的线程中运行。

As your first quote mentioned, -server enables the Java HotSpot Server VM. This means the JVM will do more aggressive just-in-time (JIT) compile optimizations. This is disabled for non-server-class machines because doing the optimizations could slow down the program too much, but with modern machines you often have cores to spare, so the optimizing JIT could be off running in its own thread while your program plugs along.

这篇关于使用java -server选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆