1 .\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
   2 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   3 .\"
   4 .\" This code is free software; you can redistribute it and/or modify it
   5 .\" under the terms of the GNU General Public License version 2 only, as
   6 .\" published by the Free Software Foundation.
   7 .\"
   8 .\" This code is distributed in the hope that it will be useful, but WITHOUT
   9 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  11 .\" version 2 for more details (a copy is included in the LICENSE file that
  12 .\" accompanied this code).
  13 .\"
  14 .\" You should have received a copy of the GNU General Public License version
  15 .\" 2 along with this work; if not, write to the Free Software Foundation,
  16 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17 .\"
  18 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19 .\" or visit www.oracle.com if you need additional information or have any
  20 .\" questions.
  21 .\"
  22 .\" Automatically generated by Pandoc 2.3.1
  23 .\"
  24 .TH "JHSDB" "1" "2018" "JDK 13" "JDK Commands"
  25 .hy
  26 .SH NAME
  27 .PP
  28 jhsdb \- attach to a Java process or launch a postmortem debugger to
  29 analyze the content of a core dump from a crashed Java Virtual Machine
  30 (JVM)
  31 .SH SYNOPSIS
  32 .PP
  33 \f[CB]jhsdb\f[R] \f[CB]clhsdb\f[R] [\f[CB]\-\-pid\f[R] \f[I]pid\f[R] |
  34 \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R]
  35 \f[I]coredump\f[R]]
  36 .PP
  37 \f[CB]jhsdb\f[R] \f[CB]debugd\f[R] [\f[I]options\f[R]] (\f[I]pid\f[R] |
  38 \f[I]executable\f[R] \f[I]coredump\f[R]) [\f[I]server\-id\f[R]]
  39 .PP
  40 \f[CB]jhsdb\f[R] \f[CB]hsdb\f[R] [\f[CB]\-\-pid\f[R] \f[I]pid\f[R] |
  41 \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R]
  42 \f[I]coredump\f[R]]
  43 .PP
  44 \f[CB]jhsdb\f[R] \f[CB]jstack\f[R] [\f[CB]\-\-pid\f[R] \f[I]pid\f[R] |
  45 \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R]
  46 \f[I]coredump\f[R]] [\f[I]options\f[R]]
  47 .PP
  48 \f[CB]jhsdb\f[R] \f[CB]jmap\f[R] [\f[CB]\-\-pid\f[R] \f[I]pid\f[R] |
  49 \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R]
  50 \f[I]coredump\f[R]] [\f[I]options\f[R]]
  51 .PP
  52 \f[CB]jhsdb\f[R] \f[CB]jinfo\f[R] [\f[CB]\-\-pid\f[R] \f[I]pid\f[R] |
  53 \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R]
  54 \f[I]coredump\f[R]] [\f[I]options\f[R]]
  55 .PP
  56 \f[CB]jhsdb\f[R] \f[CB]jsnap\f[R] [\f[I]options\f[R]] [\f[CB]\-\-pid\f[R]
  57 \f[I]pid\f[R] | \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R]
  58 \f[I]coredump\f[R]]
  59 .TP
  60 .B \f[I]pid\f[R]
  61 The process ID to which the \f[CB]jhsdb\f[R] tool should attach.
  62 The process must be a Java process.
  63 To get a list of Java processes running on a machine, use the
  64 \f[CB]ps\f[R] command or, if the JVM processes are not running in a
  65 separate docker instance, the \f[B]jps\f[R] command.
  66 .RS
  67 .PP
  68 \f[B]Note:\f[R] JDK 10 has added support for using the Attach API when
  69 attaching to Java processes running in a separate docker process.
  70 However, the \f[CB]jps\f[R] command will not list the JVM processes that
  71 are running in a separate docker instance.
  72 If you are trying to connect a Linux host with a Virtual Machine that is
  73 in a docker container, you must use tools such as \f[CB]ps\f[R] to look up
  74 the PID of the JVM.
  75 .RE
  76 .TP
  77 .B \f[I]server\-id\f[R]
  78 An optional unique ID to use when multiple debug servers are running on
  79 the same remote host.
  80 .RS
  81 .RE
  82 .TP
  83 .B \f[I]executable\f[R]
  84 The Java executable file from which the core dump was produced.
  85 .RS
  86 .RE
  87 .TP
  88 .B \f[I]coredump\f[R]
  89 The core file to which the \f[CB]jhsdb\f[R] tool should attach.
  90 .RS
  91 .RE
  92 .TP
  93 .B \f[I]options\f[R]
  94 The command\-line options for a \f[CB]jhsdb\f[R] mode.
  95 See \f[B]Common Options for jhsdb Modes\f[R], \f[B]Options for the debugd
  96 Mode\f[R], \f[B]Options for the jinfo Mode\f[R], \f[B]Options for the jmap
  97 Mode\f[R], \f[B]Options for the jmap Mode\f[R], \f[B]Options for the
  98 jstack Mode\f[R], and \f[B]Options for the jsnap Mode\f[R].
  99 .RS
 100 .RE
 101 .PP
 102 \f[B]Note:\f[R]
 103 .PP
 104 Either the \f[I]pid\f[R] or the pair of \f[I]executable\f[R] and
 105 \f[I]core\f[R] files must be provided.
 106 .SH DESCRIPTION
 107 .PP
 108 You can use the \f[CB]jhsdb\f[R] tool to attach to a Java process or to
 109 launch a postmortem debugger to analyze the content of a core\-dump from
 110 a crashed Java Virtual Machine (JVM).
 111 This command is experimental and unsupported.
 112 .PP
 113 \f[B]Note:\f[R]
 114 .PP
 115 Attaching the \f[CB]jhsdb\f[R] tool to a live process will cause the
 116 process to hang and the process will probably crash when the debugger
 117 detaches.
 118 .PP
 119 The \f[CB]jhsdb\f[R] tool can be launched in any one of the following
 120 modes:
 121 .TP
 122 .B \f[CB]jhsdb\ clhsdb\f[R]
 123 Starts the interactive command\-line debugger.
 124 .RS
 125 .RE
 126 .TP
 127 .B \f[CB]jhsdb\ debugd\f[R]
 128 Starts the remote debug server.
 129 .RS
 130 .RE
 131 .TP
 132 .B \f[CB]jhsdb\ hsdb\f[R]
 133 Starts the interactive GUI debugger.
 134 .RS
 135 .RE
 136 .TP
 137 .B \f[CB]jhsdb\ jstack\f[R]
 138 Prints stack and locks information.
 139 .RS
 140 .RE
 141 .TP
 142 .B \f[CB]jhsdb\ jmap\f[R]
 143 Prints heap information.
 144 .RS
 145 .RE
 146 .TP
 147 .B \f[CB]jhsdb\ jinfo\f[R]
 148 Prints basic JVM information.
 149 .RS
 150 .RE
 151 .TP
 152 .B \f[CB]jhsdb\ jsnap\f[R]
 153 Prints performance counter information.
 154 .RS
 155 .RE
 156 .SH COMMON OPTIONS FOR JHSDB MODES
 157 .PP
 158 In addition to any required \f[CB]jstack\f[R], \f[CB]jmap\f[R],
 159 \f[CB]jinfo\f[R] or \f[CB]jsnap\f[R] mode specific options, the
 160 \f[CB]pid\f[R], \f[CB]exe\f[R], or \f[CB]core\f[R] options must be provided
 161 for all modes.
 162 The following options are available for all modes.
 163 .TP
 164 .B \f[CB]\-\-pid\f[R]
 165 The process ID of the hanging process.
 166 .RS
 167 .RE
 168 .TP
 169 .B \f[CB]\-\-exe\f[R]
 170 The executable file name.
 171 .RS
 172 .RE
 173 .TP
 174 .B \f[CB]\-\-core\f[R]
 175 The core dump file name.
 176 .RS
 177 .RE
 178 .TP
 179 .B \f[CB]\-\-help\f[R]
 180 Displays the options available for the command.
 181 .RS
 182 .RE
 183 .SH OPTIONS FOR THE DEBUGD MODE
 184 .TP
 185 .B \f[I]server\-id\f[R]
 186 An optional unique ID for this debug server.
 187 This is required if multiple debug servers are run on the same machine.
 188 .RS
 189 .RE
 190 .SH OPTIONS FOR THE JINFO MODE
 191 .PP
 192 Without specified options, the \f[CB]jhsdb\ jinfo\f[R] prints both flags
 193 and properties.
 194 .TP
 195 .B \f[CB]\-\-flags\f[R]
 196 Prints the VM flags.
 197 .RS
 198 .RE
 199 .TP
 200 .B \f[CB]\-\-sysprops\f[R]
 201 Prints the Java system properties.
 202 .RS
 203 .RE
 204 .TP
 205 .B no option
 206 Prints the VM flags and the Java system properties.
 207 .RS
 208 .RE
 209 .SH OPTIONS FOR THE JMAP MODE
 210 .PP
 211 In addition to the following mode specific options, the \f[CB]pid\f[R],
 212 \f[CB]exe\f[R], or \f[CB]core\f[R] options described in \f[B]Common Options
 213 for jhsdb Modes\f[R] must be provided.
 214 .TP
 215 .B no option
 216 Prints the same information as Solaris \f[CB]pmap\f[R].
 217 .RS
 218 .RE
 219 .TP
 220 .B \f[CB]\-\-heap\f[R]
 221 Prints the \f[CB]java\f[R] heap summary.
 222 .RS
 223 .RE
 224 .TP
 225 .B \f[CB]\-\-binaryheap\f[R]
 226 Dumps the \f[CB]java\f[R] heap in \f[CB]hprof\f[R] binary format.
 227 .RS
 228 .RE
 229 .TP
 230 .B \f[CB]\-\-dumpfile\f[R]
 231 Prints the name of the dumpfile.
 232 .RS
 233 .RE
 234 .TP
 235 .B \f[CB]\-\-histo\f[R]
 236 Prints the histogram of \f[CB]java\f[R] object heap.
 237 .RS
 238 .RE
 239 .TP
 240 .B \f[CB]\-\-clstats\f[R]
 241 Prints the class loader statistics.
 242 .RS
 243 .RE
 244 .TP
 245 .B \f[CB]\-\-finalizerinfo\f[R]
 246 Prints the information on objects awaiting finalization.
 247 .RS
 248 .RE
 249 .SH OPTIONS FOR THE JSTACK MODE
 250 .PP
 251 In addition to the following mode specific options, the \f[CB]pid\f[R],
 252 \f[CB]exe\f[R], or \f[CB]core\f[R] options described in \f[B]Common Options
 253 for jhsdb Modes\f[R] must be provided.
 254 .TP
 255 .B \f[CB]\-\-locks\f[R]
 256 Prints the \f[CB]java.util.concurrent\f[R] locks information.
 257 .RS
 258 .RE
 259 .TP
 260 .B \f[CB]\-\-mixed\f[R]
 261 Attempts to print both \f[CB]java\f[R] and native frames if the platform
 262 allows it.
 263 .RS
 264 .RE
 265 .SH OPTIONS FOR THE JSNAP MODE
 266 .PP
 267 In addition to the following mode specific option, the \f[CB]pid\f[R],
 268 \f[CB]exe\f[R], or \f[CB]core\f[R] options described in \f[B]Common Options
 269 for jhsdb Modes\f[R] must be provided.
 270 .TP
 271 .B \f[CB]\-\-all\f[R]
 272 Prints all performance counters.
 273 .RS
 274 .RE