This appendix presents a summary of tools available in the current release of Java SE, as well as the changes since the previous release.
This section lists the troubleshooting tools available by platform: Unix (Solaris OS and Linux) and Windows.
D.1.1 Solaris OS and Linux
All the JDK troubleshooting tools that are described in this document are available in Java SE 6 on both Solaris OS and Linux.
D.1.2 Windows Operating System
The following JDK troubleshooting tools are also available in Java SE 6 on the Windows operating system.
jinfoutility - only the option
jmaputility - only the following options:
jmap -dump:format=b,file= file pid
jmap -histo[:live] pid
jpsutility (not currently available on Windows 98 or Windows ME)
jstackutility - only the option
jstatutility (not currently available on Windows 98 or Windows ME)
jstatddaemon (not currently available on Windows 98 or Windows ME)
visualgctool (not currently available on Windows 98 or Windows ME)
This is a list of changes to the JDK troubleshooting tools and options from J2SE 1.5 to Java SE 6.
jhatcommand–line tool. This new tool has the same functionality as HAT, with the following additional enhancements:
jhat can parse incomplete and truncated heap dumps.
jhat can read heap dumps generated on 64–bit systems.
jhat supports Object Query Language (OQL), with which you can create your own queries on the heap dump.
For information about HAT, see Java 2 Platform, Standard Edition 5.0, Troubleshooting and Diagnostic Guide, which is located here.
A new user interface (button) is provided for deadlock detection, including
The Connection dialog is new.
The Overview tab is new.
You no longer need to specify the
-Dcom.sun.management.jmxremote command-line option when starting the application to be monitored.
You can connect to a VM using the attach mechanism.
You can pass a flag on the command line to the VM that is running JConsole.
com.sun.management.HotSpotDiagnostic MBean property is new. In the MBean tab, you can use this property to dump heap, get and set VM options, and change management options dynamically.
jdbtool has the following changes:
Shows return values in method and exit traces.
Trace method entry/exit without stopping.
ProcessAttachingConnector is new.
jinfotool has the following changes:
jinfo -flag option allows you to dynamically set, unset, and change the values of certain Java VM flags for a specified Java process.
jinfo command is new to Windows, but only the option
jinfo -flag pid.
jmapcommand has the following changes:
jmap -finalizerinfo option is new. With this option, the command prints information on objects awaiting finalization.
jmap -permstat option has been updated to print also the number and size of internalized
jmap -dump:format=b,file= filename option is new. With this option,
jmap obtains a heap dump from a running process or from a core file and writes it in binary
HPROF format to a specified file. This file can then be analyzed with the
jmap -F option is new and is for Solaris OS and Linux only. This option forces the use of the Serviceability Agent in case the process does not respond.
jmap -J option is new and is for Solaris OS and Linux only. This option passes flags to the VM on which
jmap is running.
live suboption is new for the
histo option. With this suboption only live objects are counted.
jmap command is new to Windows, but only the
jmap -dump: dump-options pid option and the
jmap -histo[:live] pid option.
jrunscripttool is new.
jstackcommand has the following changes:
jstack pid option has been changed to work like remote Ctrl-Break, that is, the output of the thread dump is slightly different, and there is more information on deadlocks and JNI Global References.
jstack -F option is new and is for Solaris OS and Linux only. This option forces a thread dump in case the VM is hung.
jstack -l option is new. This option prints information about ownable synchronizers (locks) in the heap.
jstack command is new to Windows, but only the
jstack pid option and the
jstack -l pid option.
-XX:OnOutOfMemoryError=string option allows you to specify a command or script to be run when an
OutOfMemoryErroris first thrown. This is useful for data capture, for example, with
-XX:+HeapDumpOnOutOfMemoryErrorcommand-line option is new as of Java SE release 5 update 7. If this option is set and the VM detects a native out–of–memory error, a heap dump is generated. See B.1.2
hotspot_jni. (Solaris 10 OS only)
fastdebugbuilds can be useful for testing, diagnosing, and isolating problems. However, they should not be used in production environments.
Ctrl-Break now shows the thread state.
Ctrl-Break now shows the sizes of the heap areas.
-XX:+PrintConcurrentLocks, Ctrl-Break will also print the list of concurrent locks owned by each thread, as well as detect deadlocks involving both monitor locks and concurrent locks.
HPROF format=boption now includes primitive type instance fields and primitive array content in heap dumps.
java.lang.OutOfMemoryErrorerror is thrown, a stack trace is now printed also. In addition, when the specific message indicates that the system is almost out of swap space (
Out of swap space?), a fatal error log is now generated.