Options and default values |
Default values and Restrictions |
Describe |
-xx:-citime |
1.4 introduced. Enabled by default |
Printing JIT compiler compilation time-consuming. |
-xx:errorfile=./hs_err_pid<pid>.log |
Introduced in Java 6. |
If the JVM crashed, output the error log to the specified file path. |
-xx:-extendeddtraceprobes |
Java6 introduced, limited to Solaris Not enabled by default |
Enable DTrace Diagnostics. |
-xx:heapdumppath=./java_pid<pid>.hprof |
The default is the Java process startup location, which is User.dir |
The storage file path for the heap memory snapshot. What is a heap memory snapshot? When the Java process is forcibly terminated by the OS due to oom or crash, a heap memory snapshot file in Hprof (heap profling) format is generated. This file is used for offline debugging, diagnosing, and finding problems. File names are generally Java_<pid>_<date>_<time>_heapdump.hprof Parsing snapshot files, you can use Jhat, Eclipse mat,gdb and other tools. |
-xx:-heapdumponoutofmemoryerror |
1.4.2 Update12 and 5.0 update 7 were introduced. Not enabled by default |
In Oom, output a Dump.core file that records the heap memory snapshot at that time (what is a heap memory snapshot?). See the description at-xx:heapdumppath). |
-xx:onerror= "<cmd args>;<cmd args>" |
1.4.2 Update 9 introduced |
When Java throws an error each time, the specified command-line instruction set is run. The instruction set is related to the OS environment, most of which are bash scripts under Linux and DOS batches under Windows. |
-xx:onoutofmemoryerror= "<cmd args>; <cmd args> " |
1.4.2 Update 12 and JAVA6 are introduced |
When an oom occurs for the first time, run the specified command-line instruction set. The instruction set is related to the OS environment, most of which are bash scripts under Linux and DOS batches under Windows. |
-xx:-P Rintclasshistogram |
Not enabled by default |
Under Windows, the class histogram is printed when you press Ctrl-break or Linux to perform kill-3 (send Sigquit signal). The Jmap–histo PID also achieves the same function. See http://java.sun.com/javase/6/docs/technotes/tools/share/jmap.html |
-xx:-P Rintconcurrentlocks |
Not enabled by default |
At the same time as thread dump, print the lock state of the java.util.concurrent. The Jstack–l PID also achieves the same function. See http://java.sun.com/javase/6/docs/technotes/tools/share/jstack.html |
-xx:-P Rintcommandlineflags |
5.0 introduced, not enabled by default |
When Java starts, print the currently enabled non-stationary JVM options to stdout. For example: -xx:+useconcmarksweepgc-xx:+heapdumponoutofmemoryerror-xx:+doescapeanalysis |
-xx:-P rintcompilation |
Not enabled by default |
The information to be JIT-compiled for the StdOut printing method. For example: 1 Java.lang.string::charat (bytes) |
-xx:-P RINTGC |
Not enabled by default |
Turn on GC log printing. Printing formats such as: [Full GC 131115k->7482k (1015808K), 0.1633180 secs] This option is enabled dynamically through the Com.sun.management.HotSpotDiagnosticMXBean API and Jconsole. See http://java.sun.com/developer/technicalArticles/J2SE/monitoring/#Heap_Dump |
-xx:-P Rintgcdetails |
1.4.0 introduced, not enabled by default |
Print the details of GC reclamation. Printing formats such as: [Full GC (System) [tenured:0k->2394k (466048K), 0.0624140 secs] 30822k->2394k (518464K), [perm:10443k->10443k ( 16384K)], 0.0625410 secs] [times:user=0.05 sys=0.01, real=0.06 secs] This option is enabled dynamically through the Com.sun.management.HotSpotDiagnosticMXBean API and Jconsole. See http://java.sun.com/developer/technicalArticles/J2SE/monitoring/#Heap_Dump |
-xx:-P rintgctimestamps |
Default does not enable |
Printing GC pauses time-consuming. Print format for example: 2.744 : [Full GC (System) 2.744: [tenured:0k->2441k (466048K), 0.0598400 secs] 31754k->2441k (518464K), [perm:10717k->10717k (16384K)], 0.0599570 secs] [times:user=0.06 sys= 0.00, real=0.06 secs] This option is enabled dynamically through the Com.sun.management.HotSpotDiagnosticMXBean API and Jconsole. See http://java.sun.com/developer/technicalarticles/j2se/monitoring/#Heap_Dump |
-xx:-P rinttenuringdistribution |
Not enabled by default |
Prints the lifetime information of the object. Printing formats such as: [GC Desired survivor size 4653056 bytes, new threshold (Max 32) -Age 1:2330640 Bytes, 2330640 total -Age 2:9520 Bytes, 2340160 total 204009k->21850k (515200K), 0.1563482 secs] Age1 2 represents the size of the object that survived after the 1th and 2 GC. |
-xx:-traceclassloading |
Not enabled by default |
Print class loading information to stdout. Remember loaded status. For example: [Loaded Java.lang.Object From/opt/taobao/install/jdk1.6.0_07/jre/lib/rt.jar] |
-xx:-traceclassloadingpreorder |
1.4.2 introduced, not enabled by default |
Print class loading information to stdout by class reference/dependency order. Unlike traceclassloading, this option only registers loading status. For example: [Loading Java.lang.Object From/home/confsrv/jdk1.6.0_14/jre/lib/rt.jar] |
-xx:-traceclassresolution |
1.4.2 introduced, not enabled by default |
Prints all static classes, constant code reference locations. For Debug. For example: RESOLVE Java.util.HashMap java.util.hashmap$entry hashmap.java:209 Describes the 209 rows of the HashMap class that reference a static class Java.util.hashmap$entry |
-xx:-traceclassunloading |
Not enabled by default |
Prints the unload information for class to stdout. Remember unloaded status. |
-xx:-traceloaderconstraints |
Java6 introduced, not enabled by default |
Prints the load policy change information for class to stdout. For example: [Adding new constraint for name:java/lang/string, loader[0]: sun/misc/launcher$ Extclassloader, loader[1]: <bootloader>] [Setting class object in existing constraint for name: [ljava/lang/ Object; and loader Sun/misc/launcher$extclassloader] [Updating constraint for name Org/xml/sax/inputsource, loader < Bootloader>, by setting class object] [extending constraint for name java/lang/object by adding loader[15]: sun/ reflect/delegatingclassloader ] Load policy changes are key technologies for ClassLoader isolation/namespace consistency. For those who are interested in this, see Contraint in Http://kenwublog.com/docs/Dynamic+Class+Loading+in+the+Java+Virtual+Machine.pdf Rules chapter. |
-xx:+perfsavedatatofile |
Enabled by default |
When the Java process is forced to terminate with Oom or crashed, a heap snapshot file is generated (what is a heap memory snapshot?). See the description at-xx:heapdumppath). |