JVM options

Claudio Nieder private at claudio.ch
Wed Jan 30 16:34:14 PST 2013


Hi,

> http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

Those mentioned there should work in your standard JDK.

Besides there are those which are accessible only once you specify 

-XX:+UnlockDiagnosticVMOptions
-XX:+UnlockExperimentalVMOptions

and finally there are some which are only available if you compile the JDK yourself and enable additional debugging support.

As I have seen, you can look at

http://hg.openjdk.java.net/jdk7u/jdk7u/hotspot/file/9b0ca45cd756/src/share/vm/runtime/globals.hpp

to get a good overview of all the options hotspot knows about and the condition under which they can be used. E.g.

   product(bool, PrintGCApplicationConcurrentTime, false,                    \
           "Print the time the application has been running")                \

means you can use -XX:+PrintGCApplicationConcurrentTime in your regular JDK while

   develop(bool, PrintVMMessages, true,                                      \
           "Print vm messages on console")                                   \

would require your special built JDK so you can use -XX:+PrintVMMessages.

If a flag is unsupported, then java will exit with an error message right away, e.g. 

$ java -XX:+PrintVMMessage
Unrecognized VM option 'PrintVMMessage'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Flags in diagnostic(...) or experimental(...) are only available if unlocked with one of the options I mentioned at the beginning of this mail.

Lines 346 to 408 in the globals.hpp explain the different categories of flags.

As you can see in lines 28 to 117 other files are included, which slightly modify the list of available flags or their default values depending on target architecture or OS. 

Finally let me add, that not all flags are found in globals.hpp, a few are handled in these files

http://hg.openjdk.java.net/jdk7u/jdk7u/hotspot/file/9b0ca45cd756/src/share/vm/runtime/arguments.cpp
http://hg.openjdk.java.net/jdk7u/jdk7u/hotspot/file/bfa88fb4cb01/src/share/tools/launcher/java.c

claudio
-- 
Claudio Nieder, Talweg 6, CH-8610 Uster, Tel +4179 357 6743, www.claudio.ch






More information about the macosx-port-dev mailing list