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

2022-01-16 00:00:00 jvm java jvm-hotspot

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

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:

$ 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:

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

是的,你是对的,我也查过了并且 Compressed Oops 未激活默认情况下,在 Java6u21 64 位中,我这样做不明白为什么在里面这么说我提供的链接.

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.

我尝试使用 jconsole/JMX 检查它,但没有找到名为 CompressedOops 或类似名称的属性.

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

有人知道我在哪里可以得到一个包含默认值的特定构建的所有 jvm 选项的列表吗?

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

问候詹宁

推荐答案

你可以使用-XX:+PrintFlagsFinal 来打印JVM启动时所有flags的值.

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

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

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

> jinfo -flag UseCompressedOops 7364
-XX:+UseCompressedOops

使用jps查找进程的pid.

Use jps to find the pid of the process.

相关文章