www.LinuxHowtos.org
JHSDB
Section: JDK Commands (1)Updated: 2023
Index Return to Main Contents
NAME
jhsdb- attach to a Java process or launch a postmortem debugger to analyze the content of a core dump from a crashed Java Virtual Machine (JVM)
SYNOPSIS
V]jhsdbR] V]clhsdbR] [V-pidR] I]pidR] | V-exeR] I]executableR] V-coreR] I]coredumpR]]
V]jhsdbR] V]hsdbR] [V-pidR] I]pidR] | V-exeR] I]executableR] V-coreR] I]coredumpR]]
V]jhsdbR] V]debugdR] (V-pidR] I]pidR] | V-exeR] I]executableR] V-coreR] I]coredumpR]) [I]optionsR]]
V]jhsdbR] V]jstackR] (V-pidR] I]pidR] | V-exeR] I]executableR] V-coreR] I]coredumpR] | V-connectR] I][serve-id[at]]debug-hostR]) [I]optionsR]]
V]jhsdbR] V]jmapR] (V-pidR] I]pidR] | V-exeR] I]executableR] V-coreR] I]coredumpR] | V-connectR] I][serve-id[at]]debug-hostR]) [I]optionsR]]
V]jhsdbR] V]jinfoR] (V-pidR] I]pidR] | V-exeR] I]executableR] V-coreR] I]coredumpR] | V-connectR] I][serve-id[at]]debug-hostR]) [I]optionsR]]
V]jhsdbR] V]jsnapR] (V-pidR] I]pidR] | V-exeR] I]executableR] V-coreR] I]coredumpR] | V-connectR] I][serve-id[at]]debug-hostR]) [I]optionsR]]
- I]pidR]
- The process ID to which the V]jhsdbR] tool should attach. The process must be a Java process. To get a list of Java processes running on a machine, use the V]psR] command or, if the JVM processes are not running in a separate docker instance, the B]jpsR] command.
- I]executableR]
- The Java executable file from which the core dump was produced.
- I]coredumpR]
- The core file to which the V]jhsdbR] tool should attach.
- I][serve-id[at]]debug-hostR]
- An optional server ID and the address of the remote debug server (debugd).
- I]optionsR]
- The comman-line options for a V]jhsdbR] mode. See B]Options for the debugd ModeR], B]Options for the jstack ModeR], B]Options for the jmap ModeR], B]Options for the jinfo ModeR], and B]Options for the jsnap ModeR].
B]Note:R]
Either the I]pidR] or the pair of I]executableR] and I]coreR] files or the I][serve-id[at]]debug-hostR] must be provided for V]debugdR], V]jstackR], V]jmapR], V]jinfoR] and V]jsnapR] modes.
DESCRIPTION
You can use the V]jhsdbR] tool to attach to a Java process or to launch a postmortem debugger to analyze the content of a cor-dump from a crashed Java Virtual Machine (JVM). This command is experimental and unsupported.
B]Note:R]
Attaching the V]jhsdbR] tool to a live process will cause the process to hang and the process will probably crash when the debugger detaches.
The V]jhsdbR] tool can be launched in any one of the following modes:
- V]jhsdb clhsdbR]
- Starts the interactive comman-line debugger.
- V]jhsdb hsdbR]
- Starts the interactive GUI debugger.
- V]jhsdb debugdR]
- Starts the remote debug server.
- V]jhsdb jstackR]
- Prints stack and locks information.
- V]jhsdb jmapR]
- Prints heap information.
- V]jhsdb jinfoR]
- Prints basic JVM information.
- V]jhsdb jsnapR]
- Prints performance counter information.
- V]jhsdbR] I]commandR] V-helpR]
- Displays the options available for the I]commandR].
OPTIONS FOR THE DEBUGD MODE
- V-serveridR] I]serve-idR]
- An optional unique ID for this debug server. This is required if multiple debug servers are run on the same machine.
- V-rmiportR] I]portR]
- Sets the port number to which the RMI connector is bound. If not specified a random available port is used.
- V-registryportR] I]portR]
- Sets the RMI registry port. This option overrides the system property [aq]sun.jvm.hotspot.rmi.port[aq]. If not specified, the system property is used. If the system property is not set, the default port 1099 is used.
- V-hostnameR] I]hostnameR]
- Sets the hostname the RMI connector is bound. The value could be a hostname or an IPv4/IPv6 address. This option overrides the system property [aq]java.rmi.server.hostname[aq]. If not specified, the system property is used. If the system property is not set, a system hostname is used.
OPTIONS FOR THE JINFO MODE
- V-flagsR]
- Prints the VM flags.
- V-syspropsR]
- Prints the Java system properties.
- no option
- Prints the VM flags and the Java system properties.
OPTIONS FOR THE JMAP MODE
- no option
- Prints the same information as Solaris V]pmapR].
- V-heapR]
- Prints the V]javaR] heap summary.
- V-binaryheapR]
- Dumps the V]javaR] heap in V]hprofR] binary format.
- V-dumpfileR] I]nameR]
- The name of the dumpfile.
- V-histoR]
- Prints the histogram of V]javaR] object heap.
- V-clstatsR]
- Prints the class loader statistics.
- V-finalizerinfoR]
- Prints the information on objects awaiting finalization.
OPTIONS FOR THE JSTACK MODE
- V-locksR]
- Prints the V]java.util.concurrentR] locks information.
- V-mixedR]
- Attempts to print both V]javaR] and native frames if the platform allows it.
OPTIONS FOR THE JSNAP MODE
- V-allR]
-
Prints all performance counters.