Java HotSpot 虚拟机选项 -X -XX 的含义

1、JDK 7 及以前版本

官方文档对 -X、-XX的说明如下:
Options that begin with -X are non-standard (not guaranteed to be supported on all VM implementations), and are subject to change without notice in subsequent releases of the JDK.

以 -X 开头的选项是非标准选项(不能保证被所有的 JVM 实现都支持),并且在 JDK 的后续版本中不需要通知就可以进行更改。

Options that are specified with -XX are not stable and are subject to change without notice.

以 -XX 指定的选项是不稳定的,并且会在没有通知的情况下进行更改。

2、JDK 8 版本

相对于非标准选项,标准选项保证得到所有 Java 虚拟机(JVM)的实现支持。它们用于常见的操作,如检查 JRE 版本、设置类路径、启用详细输出等等。

-X:非标准选项

Non-standard options are general purpose options that are specific to the Java HotSpot Virtual Machine, so they are not guaranteed to be supported by all JVM implementations, and are subject to change. These options start with -X.

以 -X 开头的这些选项是非标准选项,是特定于 Java HotSpot 虚拟机的通用选项,不保证所有 JVM 的实现都支持它们,而且还会发生变化。

-X:非标准选项

Advanced options are not recommended for casual use. These are developer options used for tuning specific areas of the Java HotSpot Virtual Machine operation that often have specific system requirements and may require privileged access to system configuration parameters. They are also not guaranteed to be supported by all JVM implementations, and are subject to change. Advanced options start with -XX.

以 -XX 开头的选项是高级选项,高级选项不建议随意使用。这些是开发人员用于调优 Java HotSpot 虚拟机操作的特定区域的选项,这些选项通常具有特定的系统需求,并且可能需要特权访问系统配置参数。它们也不保证得到所有 JVM 的实现的支持,并且可能会发生变化。

具体的选项可以参看下面列的参考文章。


参考文章:
Java HotSpot VM Options

Java Platform, Standard Edition Tools Reference

猜你喜欢

转载自blog.csdn.net/zhouxukun123/article/details/80028062