You may have read Top 10 Things You Need to Know
about Mustang (Java SE 6)
beta-2. That top 10 covers the entire JDK. This is a Java Observability top 10:
- attach-on-demand API
java.lang.instrument and JVM TI agents need not be loaded at the application start-up. Agents may be loaded "on demand".
- jconsole improvementsMore details: Mustang's jconsole - Mandy Chung
- java.util.concurrent lock information in stack traces
- 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
- 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:
In addition, DTrace probes flag - ExtendedDTraceProbes flag - can also be turned on/off by jinfo
- 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
- jmap prints information on internalized Strings (count and total byte size) of internalized strings is printed with -permstat option
- New -finalizerinfo option with jmap - prints summary information on objects waiting to be finalized.