This chapter introduces the various diagnostic and monitoring tools which can be used with Java Platform Standard Edition Development Kit 6 (JDK 6 or Java SE 6). The tools are described in detail in Chapter 2, Detailed Tool Descriptions.
See Appendix D, Summary of Tools in This Release for a list of tools available in this release of Java SE, as well as the changes since the previous release.
Note - Some of the command-line utilities described in this chapter are experimental. The jstack, jinfo, and jmap utilities are examples of utilities that are experimental. These utilities are subject to change in future JDK releases, and might not be included in future releases.
Most of the command-line utilities described in this chapter are either included in the JDK release or are operating system tools and utilities. Although the JDK command-line utilities are included in the JDK download, it is important to note that they can be used to diagnose issues and monitor applications that are deployed with the Java runtime environment (JRE).
In general, the diagnostic tools and options described in this chapter use various mechanisms to obtain the information they report. In many cases the mechanisms are specific to the virtual machine implementation, operating system, and version of each. Consequently, there is some overlap of the information reported by some of the tools. This should be viewed in the context of the various problems and issues for which these tools are intended. In many cases only a subset of the tools will be applicable to a given issue at a particular point in time.
Command-line options that are prefixed with -XX are specific to the Java HotSpot Virtual Machine. Many of these options are important for performance tuning and diagnostic purposes, and are therefore described in this guide. See B.1 HotSpot VM Command-Line Options.
However, it is important to note that these -XX options are not part of the Java API and can vary from one release to the next.
In some cases, the tools described here are available only for some operating systems. In addition, Solaris 10 OS introduced many advanced diagnostic features and tools that can be used in production environments, and many of the native tools are capable of providing information that is specific to the Java runtime environment.
The format of log files and of other output from command-line utilities or options is version-specific. For example, if you develop a script that relies on the format of the fatal error log, then this script might cease to work as expected if the format of the log file changes in the future.
In addition to the tools described in this document, you can develop new tools using the APIs that are provided with the JDK release. See 2.17 Developing Diagnostic Tools.
The tools and options are divided into the following categories, where certain tools might fall into more than one category. The tools and options are described in detail in further sections.
Post-mortem diagnostics. These tools and options can be used to diagnose a problem after an application has crashed. See 1.2.1 Tools and Options for Post-mortem Diagnostics.
Hung processes. These tools can be used to investigate a hung or deadlocked process. See 1.2.2 Tools and Options for Hung Processes.
Monitoring. These tools can be used to monitor a running application. See 1.2.3 Tools and Options for Monitoring.
Other. These tools and options can be used to help diagnose other issues. See 1.2.4 Other Tools, Options, Variables, and Properties.
Operating system tools. These tools are provided by the specific operating systems. See 2.16 Operating-System-Specific Tools.
This section summarizes the options and tools that are designed for post-mortem diagnostics. If an application crashes, these options and tools can be used to obtain additional information, either at the time of the crash or later using information from the crash dump.
The options and tools in this list can help in scenarios involving a hung or deadlocked process. These tools do not require any special options to start the application.
These tools are designed for monitoring applications that are running at the time.
In addition to the tools that are designed for specific types of problems, these tools, options, variables, and properties can help in diagnosing other issues.