Observability Top 10 in Mustang
By sundararajan on Jun 19, 2006
- attach-on-demand API
- jconsole improvements
- For local monitoring -Dcom.sun.management.jmxremote need not be used with the commandline (of the monitored application).
- jconsole is a supported tool! - Mandy Chung
- jconsole plugins - sample plugins (jtop, script shell)
- UI improvements and so on.
- java.util.concurrent lock information in stack traces
- New -l option in jstack to dump java.util.concurrent locks and deadlocks due to those
- Ctrl-Break (or Ctrl-\\) handler prints util.concurrent locks if -XX:+PrintConcurrentLocks is specified in the command line
- Java heap dumps
Java heap snapshot can be dumped into a binary format file (a.k.a hprof binary format). The format is specified http://heap-snapshot.dev.java.net There are many ways to dump the heap
- Using -dump option with jmap against a live process
- Running jmap against a core dump (on Solaris and Linux)
- Running hprof profiler with -Xrunhprof:format=b option
- Starting the JVM with -XX:+HeapDumpOnOutOfMemoryError option - with this option JVM dumps heap when OutOfMemoryError is thrown.
- Programatically using HotSpotDiagnosticMXBean
- Heap dump analysis using jhat
jhat - Java Heap Analysis Tool can be used to analyze the heapdumps produced by above means.
- DTrace Java support
- New DTrace probes for hotspot JVM
- Few Java level probes (such as method-entry) require you to start the JVM with -XX:+ExtendedDTraceProbes flag - this can be avoided using jinfo tool. jinfo can be used to turn on/off the flag dynamically. see below...
- In Tiger (Java 5.0), a new DTrace built-in function named jstack() was added to print Java frames in stack traces. In Mustang, Java method signatures are shown in jstack() output
- Turing on JVM flags dynamically
Few JVM command line options can be turned on/off dynamically (from outside the process). Only a subset of flags - called manageable flags - can be turned on/off (or set) dynamically. Two ways:
- Using HotSpotDiagnosticMXBean programatically or through jconsole
- Using jinfo with -flag +/- <flag-name> option
- New tools (with subset of options) on Windows
- jstack (-l option and no options only, for live processes only). No mixed mode stack trace support.
- jmap (-dump and -histo options only). i.e., heap dump and heap histogram options only.
- jinfo (-flag and -flag +/- <flag-name> options only). i.e., only printing a JVM -XX flag value or turning on/off a JVM flag dynamically (of a live process).
- Better OutOfMemoryError!
OutOfMemoryError looks a bit better! - better detail message and stack trace with OOM exception!
- Misc. command line tools improvements