JVM的manageable参数可以通过jmx进行修改(参见这里 )
例如:
jinfo -flag +HeapDumpAfterFullGC ${java_pid} 开启HeapDumpAfterFullGC
jinfo -flag -HeapDumpAfterFullGC ${java_pid} 关闭HeapDumpAfterFullGC
此处列出所有的JVM中manageable的参数列表(参见openjdk ./hotspot/src/share/vm/runtime/globals.hpp)
| JVM manageable parameters | ||
| 参数 | 默认值 | 用途 |
| HeapDumpBeforeFullGC | FALSE | Dump heap to file before any major stop-world GC |
| HeapDumpAfterFullGC | FALSE | Dump heap to file after any major stop-world GC |
| HeapDumpOnOutOfMemoryError | FALSE | Dump heap to file when java.lang.OutOfMemoryError is thrown |
| HeapDumpPath | null | When HeapDumpOnOutOfMemoryError is on, the path (filename or directory) of the dump file (defaults to java_pid<pid>.hprof in the working directory) |
| PrintGC | FALSE | Print message at garbage collect |
| PrintGCDetails | FALSE | Print more details at garbage collect |
| PrintGCDateStamps | FALSE | Print date stamps at garbage collect |
| PrintGCTimeStamps | FALSE | Print timestamps at garbage collect |
| PrintClassHistogramBeforeFullGC | FALSE | Print a class histogram before any major stop-world GC |
| PrintClassHistogramAfterFullGC | FALSE | Print a class histogram after any major stop-world GC |
| PrintClassHistogram | FALSE | Print a histogram of class instances |
| PrintConcurrentLocks | FALSE |
|
另外,在JVM上的mbean: com.sun.management:type=HotSpotDiagnostic的DiagnosticOptions属性中,也可以看到这些属性
本文介绍了如何通过JMX修改JVM的管理参数,并列举了详细的JVM管理参数及其默认值与用途,如HeapDumpAfterFullGC等。
1199

被折叠的 条评论
为什么被折叠?



