In addition to the tools that are designed for specific types of problems, the tools, options, variables, and properties listed in Table 2-5 can help in diagnosing other issues.
The release of JDK 8 introduced Java Mission Control, Java Flight Recorder, and jcmd
utility for diagnosing problems with JVM and Java applications. It is suggested to use the latest utility, jcmd
instead of the previous jstack
, jinfo,
and jmap
utilities for enhanced diagnostics and reduced performance overhead.
Table 2-5 General Troubleshooting Tools and Options
Tool or Option | Description and Usage |
---|---|
Java Mission Control |
Java Mission Control (JMC) is a new JDK profiling and diagnostic tools platform for HotSpot JVM. It s a tool suite basic monitoring, managing, and production time profiling and diagnostics with high performance. Java Mission Control minimizes the performance overhead that's usually an issue with profiling tools. See Java Mission Control. |
jcmd utility |
The jcmd utility is used to send diagnostic command requests to the JVM, where these requests are useful for controlling Java Flight Recordings (JFR). The JFRs are used to troubleshoot and diagnose JVM and Java Applications with flight recording events. See The jcmd Utility. |
HPROF profiler |
This simple profiler can present CPU usage, heap allocation statistics, contention profiles, heap dumps, and states of all the monitors and threads in the Java Virtual Machine. HPROF is useful in analyzing performance, lock contention, memory leaks, and other issues. See HPROF. |
|
This utility is useful in diagnosing unnecessary object retention (or memory leaks). It can be used to browse an object dump, view all reachable objects in the heap, and show which references are keeping an object alive. See The jhat Utility. |
|
This utility can dynamically set, unset, and change the values of certain JVM flags for a specified Java process. On Oracle Solaris and Linux operating systems, it can also print configuration information. See The jinfo Utility. |
|
This utility is a command-line script shell, which supports both interactive and batch-mode script execution. See The jrunscript Utility. |
Oracle Solaris Studio |
This is an interactive, command-line debugging tool, which allows you to have complete control of the dynamic execution of a program, including stopping the program and inspecting its state. For details, see the latest |
Oracle Solaris Studio Performance Analyzer |
This tool can help you assess the performance of your code, identify potential performance problems, and locate the part of the code where the problems occur. The Performance Analyzer can be used from the command line or from a graphical user interface. For details, see the Oracle Solaris Studio Performance Analyzer. |
Sun's Dataspace Profiling: DProfile |
This tool provides insight into the flow of data within Sun computing systems, helping you identify bottlenecks in both software and hardware. DProfile is supported in the Sun Studio 11 compiler suite through the Performance Analyzer GUI. For more details, see DTrace or Dynamic Tracing diagnostic tool. |
|
This option is useful in diagnosing problems with applications that use the Java Native Interface (JNI) or that employ third-party libraries (some JDBC drivers, for example). See The -Xcheck:jni Option. |
|
This option enables logging of class loading and unloading. See The -verbose:class Option. |
|
This option enables logging of garbage collection information. See The -verbose:gc Option. |
|
This option enables logging of JNI. See The -verbose:jni Option. |
|
This environment variable allows you to specify the initialization of tools, specifically the launching of native or Java programming language agents using the |
|
This system property controls whether the security checks in the JRE of the Java print trace messages during execution. See The |