java 我如何知道为 Sun JVM 启用了哪些默认设置?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5231393/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 10:06:33  来源:igfitidea点击:

How do i know which default settings are enabled for Sun JVM?

javajvmjvm-hotspot

提问by Janning

i want to try CompressedOops on my JVM. No I wonder if it might be enabled by default. I run this jvm on debian/squeeze:

我想在我的 JVM 上尝试 CompressedOops。不,我想知道它是否可能默认启用。我在 debian/squeeze 上运行这个 jvm:

$ java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)

Some people say it is enabled by default, some say it is not:

有人说它默认启用,有人说它不是:

from: http://forums.yourkit.com/viewtopic.php?f=3&t=3185

来自:http: //forums.yourkit.com/viewtopic.php?f=3&t=3185

Yes, you are right, I also checked it and Compressed Oops is not activated by default in Java6u21 64-bit, I do not understand why it said so in the links I provided.

是的,你是对的,我也检查过,在 Java6u21 64 位中默认没有激活压缩的 Oops,我不明白为什么在我提供的链接中这么说。

I tried to check it with jconsole/JMX but had no luck to find an attribute named CompressedOops or alike.

我试图用 jconsole/JMX 检查它,但没有找到一个名为 CompressedOops 或类似的属性。

Does anybody know where i get a list of all jvm options for a specific build with their default values?

有谁知道我在哪里获得特定构建的所有 jvm 选项及其默认值的列表?

regards Janning

问候詹宁

回答by staffan

You can run with -XX:+PrintFlagsFinalto print the values of all flags at startup of the JVM.

您可以-XX:+PrintFlagsFinal在 JVM 启动时运行 with打印所有标志的值。

Alternatively, you can use the jinfotool to check the value of a flag in a running JVM:

或者,您可以使用该jinfo工具检查正在运行的 JVM 中标志的值:

> jinfo -flag UseCompressedOops 7364
-XX:+UseCompressedOops

Use jpsto find the pid of the process.

使用jps查找进程的PID。