JVM Troubleshooting Tools
This chapter tutorial notes on JVM troubleshooting tools. Topics include 'jinfo' to check JVM option values, 'jstack' to dump stack traces and detect deadlocks, 'jmap' to print heap histogram and dump heap files, 'jhat' to browse head files and run OQL queries.
JVM Troubleshooting Tools in JDK
jinfo - VM Option Value Checker
jinfo - Changing HotSpot VM Option
jstack - Stack Tracer to Generate Thread Dump
What Is a Thread Dump?
Java Thread Deadlock Demo Program
jstack - Detecting Java Thread Deadlocks
jmap - JVM Heap Dump Tool
Printing Histogram of Java Object Heap
jmap - Generating Heap Dump File
jhat - Java Heap Analysis Tool
jhat - Starting Web Server on a Heap Dump File
Listing Instance Counts of All Classes
Browsing Object Instance Values
Object Query Language (OQL)
Searching for Instances with OQL Statements
- JDK offers a number of nice trouble shooting tools: jinfo, jstack, jmap, and jhat.
- jinfo allows you to check current JVM options of a running JVM process.
- jstack allows you to generate a thread dump (print all threads and their stack traces) of a JVM process. It can also be used to detect deadlocks.
- A thread dump is a snapshot of all threads that are currently in a JVM process at a given moment.
It also includes the state and stack trace of each thread.
- jmap allows you to generate a heap dump of a JVM process.
It can also be used to print memory usages and instance counts by classes.
- A heap dump is a snapshot of all data objects that are currently in a JVM process at a given moment.
- jhat allows you to browse a heap dump file with a Web interface.
- jhat also supports OQL (Object Query Language) statements - a very powerful tool to investigate
any data issues in your Java application.
Table of Contents
About This Book
Java Tools Terminology
Java Tools Included in JDK
javac - The Java Program Compiler
jar - The JAR File Tool
jlink - The JRE Linker
jmod - The JMOD File Tool
jimage - The JIMAGE File Tool
java - The Java Program Launcher
jdb - The Java Debugger
jcmd - The JVM Diagnostic Tool
jconsole - Java Monitoring and Management Console
jstat - JVM Statistics Monitoring Tool
►JVM Troubleshooting Tools
jvisualvm (Java VisualVM) - JVM Visual Tool
jmc - Java Mission Control
javap - The Java Class File Disassembler
keytool - Public Key Certificate Tool
jarsigner - JAR File Signer
jshell - Java Language Shell
native2ascii - Native-to-ASCII Encoding Converter
Full Version in PDF/EPUB