.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" .\" This code is free software; you can redistribute it and/or modify it .\" under the terms of the GNU General Public License version 2 only, as .\" published by the Free Software Foundation. .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" .\" You should have received a copy of the GNU General Public License version .\" 2 along with this work; if not, write to the Free Software Foundation, .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. .\" .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA .\" or visit www.oracle.com if you need additional information or have any .\" questions. .\" .\" Automatically generated by Pandoc 2.3.1 .\" .TH "JHSDB" "1" "2018" "JDK 13" "JDK Commands" .hy .SH NAME .PP 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) .SH SYNOPSIS .PP \f[CB]jhsdb\f[R] \f[CB]clhsdb\f[R] [\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[I]coredump\f[R]] .PP \f[CB]jhsdb\f[R] \f[CB]debugd\f[R] [\f[I]options\f[R]] (\f[I]pid\f[R] | \f[I]executable\f[R] \f[I]coredump\f[R]) [\f[I]server\-id\f[R]] .PP \f[CB]jhsdb\f[R] \f[CB]hsdb\f[R] [\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[I]coredump\f[R]] .PP \f[CB]jhsdb\f[R] \f[CB]jstack\f[R] [\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[I]coredump\f[R]] [\f[I]options\f[R]] .PP \f[CB]jhsdb\f[R] \f[CB]jmap\f[R] [\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[I]coredump\f[R]] [\f[I]options\f[R]] .PP \f[CB]jhsdb\f[R] \f[CB]jinfo\f[R] [\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[I]coredump\f[R]] [\f[I]options\f[R]] .PP \f[CB]jhsdb\f[R] \f[CB]jsnap\f[R] [\f[I]options\f[R]] [\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[I]coredump\f[R]] .TP .B \f[I]pid\f[R] The process ID to which the \f[CB]jhsdb\f[R] tool should attach. The process must be a Java process. To get a list of Java processes running on a machine, use the \f[CB]ps\f[R] command or, if the JVM processes are not running in a separate docker instance, the \f[B]jps\f[R] command. .RS .PP \f[B]Note:\f[R] JDK 10 has added support for using the Attach API when attaching to Java processes running in a separate docker process. However, the \f[CB]jps\f[R] command will not list the JVM processes that are running in a separate docker instance. If you are trying to connect a Linux host with a Virtual Machine that is in a docker container, you must use tools such as \f[CB]ps\f[R] to look up the PID of the JVM. .RE .TP .B \f[I]server\-id\f[R] An optional unique ID to use when multiple debug servers are running on the same remote host. .RS .RE .TP .B \f[I]executable\f[R] The Java executable file from which the core dump was produced. .RS .RE .TP .B \f[I]coredump\f[R] The core file to which the \f[CB]jhsdb\f[R] tool should attach. .RS .RE .TP .B \f[I]options\f[R] The command\-line options for a \f[CB]jhsdb\f[R] mode. See \f[B]Common Options for jhsdb Modes\f[R], \f[B]Options for the debugd Mode\f[R], \f[B]Options for the jinfo Mode\f[R], \f[B]Options for the jmap Mode\f[R], \f[B]Options for the jmap Mode\f[R], \f[B]Options for the jstack Mode\f[R], and \f[B]Options for the jsnap Mode\f[R]. .RS .RE .PP \f[B]Note:\f[R] .PP Either the \f[I]pid\f[R] or the pair of \f[I]executable\f[R] and \f[I]core\f[R] files must be provided. .SH DESCRIPTION .PP You can use the \f[CB]jhsdb\f[R] tool to attach to a Java process or to launch a postmortem debugger to analyze the content of a core\-dump from a crashed Java Virtual Machine (JVM). This command is experimental and unsupported. .PP \f[B]Note:\f[R] .PP Attaching the \f[CB]jhsdb\f[R] tool to a live process will cause the process to hang and the process will probably crash when the debugger detaches. .PP The \f[CB]jhsdb\f[R] tool can be launched in any one of the following modes: .TP .B \f[CB]jhsdb\ clhsdb\f[R] Starts the interactive command\-line debugger. .RS .RE .TP .B \f[CB]jhsdb\ debugd\f[R] Starts the remote debug server. .RS .RE .TP .B \f[CB]jhsdb\ hsdb\f[R] Starts the interactive GUI debugger. .RS .RE .TP .B \f[CB]jhsdb\ jstack\f[R] Prints stack and locks information. .RS .RE .TP .B \f[CB]jhsdb\ jmap\f[R] Prints heap information. .RS .RE .TP .B \f[CB]jhsdb\ jinfo\f[R] Prints basic JVM information. .RS .RE .TP .B \f[CB]jhsdb\ jsnap\f[R] Prints performance counter information. .RS .RE .SH COMMON OPTIONS FOR JHSDB MODES .PP In addition to any required \f[CB]jstack\f[R], \f[CB]jmap\f[R], \f[CB]jinfo\f[R] or \f[CB]jsnap\f[R] mode specific options, the \f[CB]pid\f[R], \f[CB]exe\f[R], or \f[CB]core\f[R] options must be provided for all modes. The following options are available for all modes. .TP .B \f[CB]\-\-pid\f[R] The process ID of the hanging process. .RS .RE .TP .B \f[CB]\-\-exe\f[R] The executable file name. .RS .RE .TP .B \f[CB]\-\-core\f[R] The core dump file name. .RS .RE .TP .B \f[CB]\-\-help\f[R] Displays the options available for the command. .RS .RE .SH OPTIONS FOR THE DEBUGD MODE .TP .B \f[I]server\-id\f[R] An optional unique ID for this debug server. This is required if multiple debug servers are run on the same machine. .RS .RE .SH OPTIONS FOR THE JINFO MODE .PP Without specified options, the \f[CB]jhsdb\ jinfo\f[R] prints both flags and properties. .TP .B \f[CB]\-\-flags\f[R] Prints the VM flags. .RS .RE .TP .B \f[CB]\-\-sysprops\f[R] Prints the Java system properties. .RS .RE .TP .B no option Prints the VM flags and the Java system properties. .RS .RE .SH OPTIONS FOR THE JMAP MODE .PP In addition to the following mode specific options, the \f[CB]pid\f[R], \f[CB]exe\f[R], or \f[CB]core\f[R] options described in \f[B]Common Options for jhsdb Modes\f[R] must be provided. .TP .B no option Prints the same information as Solaris \f[CB]pmap\f[R]. .RS .RE .TP .B \f[CB]\-\-heap\f[R] Prints the \f[CB]java\f[R] heap summary. .RS .RE .TP .B \f[CB]\-\-binaryheap\f[R] Dumps the \f[CB]java\f[R] heap in \f[CB]hprof\f[R] binary format. .RS .RE .TP .B \f[CB]\-\-dumpfile\f[R] Prints the name of the dumpfile. .RS .RE .TP .B \f[CB]\-\-histo\f[R] Prints the histogram of \f[CB]java\f[R] object heap. .RS .RE .TP .B \f[CB]\-\-clstats\f[R] Prints the class loader statistics. .RS .RE .TP .B \f[CB]\-\-finalizerinfo\f[R] Prints the information on objects awaiting finalization. .RS .RE .SH OPTIONS FOR THE JSTACK MODE .PP In addition to the following mode specific options, the \f[CB]pid\f[R], \f[CB]exe\f[R], or \f[CB]core\f[R] options described in \f[B]Common Options for jhsdb Modes\f[R] must be provided. .TP .B \f[CB]\-\-locks\f[R] Prints the \f[CB]java.util.concurrent\f[R] locks information. .RS .RE .TP .B \f[CB]\-\-mixed\f[R] Attempts to print both \f[CB]java\f[R] and native frames if the platform allows it. .RS .RE .SH OPTIONS FOR THE JSNAP MODE .PP In addition to the following mode specific option, the \f[CB]pid\f[R], \f[CB]exe\f[R], or \f[CB]core\f[R] options described in \f[B]Common Options for jhsdb Modes\f[R] must be provided. .TP .B \f[CB]\-\-all\f[R] Prints all performance counters. .RS .RE