32

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:

from: 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.

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

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

regards Janning

skaffman
  • 398,947
  • 96
  • 818
  • 769
Janning Vygen
  • 8,877
  • 9
  • 71
  • 102

1 Answers1

69

You can run with -XX:+PrintFlagsFinal to print the values of all flags at startup of the 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

Use jps to find the pid of the process.

staffan
  • 5,641
  • 3
  • 32
  • 28
  • This is a great answer. But for me it doesn't work as expected on debian squeeze: Unable to open socket file: target process not responding or HotSpot VM not loaded. it shows me a long list of values if i call it just with 'jinfo ' but in this view i don't see if CompressOops is set. – Janning Vygen Mar 18 '11 at 07:44
  • 3
    `jinfo` can also be used to turn on/off the flag dynamically, e.g. `jinfo -flag +HeapDumpOnOutOfMemoryError ` if the flag is manageable. jinfo is very useful -- even if little known -- tool. – Jarek Przygódzki Jan 20 '14 at 15:06
  • The options really useful: `-XX:+PrintFlagsFinal` – hao Aug 30 '19 at 02:42