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" "2020" "JDK 14" "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]hsdb\f[R] [\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | 38 \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] 39 \f[I]coredump\f[R]] 40 .PP 41 \f[CB]jhsdb\f[R] \f[CB]debugd\f[R] (\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | 42 \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] 43 \f[I]coredump\f[R]) [\f[I]options\f[R]] 44 .PP 45 \f[CB]jhsdb\f[R] \f[CB]jstack\f[R] (\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | 46 \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[I]coredump\f[R] 47 | \f[CB]\-\-connect\f[R] \f[I][server\-id\@]debugd\-host\f[R]) 48 [\f[I]options\f[R]] 49 .PP 50 \f[CB]jhsdb\f[R] \f[CB]jmap\f[R] (\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | 51 \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[I]coredump\f[R] 52 | \f[CB]\-\-connect\f[R] \f[I][server\-id\@]debugd\-host\f[R]) 53 [\f[I]options\f[R]] 54 .PP 55 \f[CB]jhsdb\f[R] \f[CB]jinfo\f[R] (\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | 56 \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[I]coredump\f[R] 57 | \f[CB]\-\-connect\f[R] \f[I][server\-id\@]debugd\-host\f[R]) 58 [\f[I]options\f[R]] 59 .PP 60 \f[CB]jhsdb\f[R] \f[CB]jsnap\f[R] (\f[CB]\-\-pid\f[R] \f[I]pid\f[R] | 61 \f[CB]\-\-exe\f[R] \f[I]executable\f[R] \f[CB]\-\-core\f[R] \f[I]coredump\f[R] 62 | \f[CB]\-\-connect\f[R] \f[I][server\-id\@]debugd\-host\f[R]) 63 [\f[I]options\f[R]] 64 .TP 65 .B \f[I]pid\f[R] 66 The process ID to which the \f[CB]jhsdb\f[R] tool should attach. 67 The process must be a Java process. 68 To get a list of Java processes running on a machine, use the 69 \f[CB]ps\f[R] command or, if the JVM processes are not running in a 70 separate docker instance, the \f[B]jps\f[R] command. 71 .RS 72 .PP 73 \f[B]Note:\f[R] JDK 10 has added support for using the Attach API when 74 attaching to Java processes running in a separate docker process. 75 However, the \f[CB]jps\f[R] command will not list the JVM processes that 76 are running in a separate docker instance. 77 If you are trying to connect a Linux host with a Virtual Machine that is 78 in a docker container, you must use tools such as \f[CB]ps\f[R] to look up 79 the PID of the JVM. 80 .RE 81 .TP 82 .B \f[I]executable\f[R] 83 The Java executable file from which the core dump was produced. 84 .RS 85 .RE 86 .TP 87 .B \f[I]coredump\f[R] 88 The core file to which the \f[CB]jhsdb\f[R] tool should attach. 89 .RS 90 .RE 91 .TP 92 .B \f[I][server\-id\@]debugd\-host\f[R] 93 An optional server ID and the address of the remote debug server 94 (debugd). 95 .RS 96 .RE 97 .TP 98 .B \f[I]options\f[R] 99 The command\-line options for a \f[CB]jhsdb\f[R] mode. 100 See \f[B]Options for the debugd Mode\f[R], \f[B]Options for the jstack 101 Mode\f[R], \f[B]Options for the jmap Mode\f[R], \f[B]Options for the jinfo 102 Mode\f[R], and \f[B]Options for the jsnap Mode\f[R]. 103 .RS 104 .RE 105 .PP 106 \f[B]Note:\f[R] 107 .PP 108 Either the \f[I]pid\f[R] or the pair of \f[I]executable\f[R] and 109 \f[I]core\f[R] files or the \f[I][server\-id\@]debugd\-host\f[R] must be 110 provided for \f[CB]debugd\f[R], \f[CB]jstack\f[R], \f[CB]jmap\f[R], 111 \f[CB]jinfo\f[R] and \f[CB]jsnap\f[R] modes. 112 .SH DESCRIPTION 113 .PP 114 You can use the \f[CB]jhsdb\f[R] tool to attach to a Java process or to 115 launch a postmortem debugger to analyze the content of a core\-dump from 116 a crashed Java Virtual Machine (JVM). 117 This command is experimental and unsupported. 118 .PP 119 \f[B]Note:\f[R] 120 .PP 121 Attaching the \f[CB]jhsdb\f[R] tool to a live process will cause the 122 process to hang and the process will probably crash when the debugger 123 detaches. 124 .PP 125 The \f[CB]jhsdb\f[R] tool can be launched in any one of the following 126 modes: 127 .TP 128 .B \f[CB]jhsdb\ clhsdb\f[R] 129 Starts the interactive command\-line debugger. 130 .RS 131 .RE 132 .TP 133 .B \f[CB]jhsdb\ hsdb\f[R] 134 Starts the interactive GUI debugger. 135 .RS 136 .RE 137 .TP 138 .B \f[CB]jhsdb\ debugd\f[R] 139 Starts the remote debug server. 140 .RS 141 .RE 142 .TP 143 .B \f[CB]jhsdb\ jstack\f[R] 144 Prints stack and locks information. 145 .RS 146 .RE 147 .TP 148 .B \f[CB]jhsdb\ jmap\f[R] 149 Prints heap information. 150 .RS 151 .RE 152 .TP 153 .B \f[CB]jhsdb\ jinfo\f[R] 154 Prints basic JVM information. 155 .RS 156 .RE 157 .TP 158 .B \f[CB]jhsdb\ jsnap\f[R] 159 Prints performance counter information. 160 .RS 161 .RE 162 .TP 163 .B \f[CB]jhsdb\f[R] \f[I]command\f[R] \f[CB]\-\-help\f[R] 164 Displays the options available for the \f[I]command\f[R]. 165 .RS 166 .RE 167 .SH OPTIONS FOR THE DEBUGD MODE 168 .TP 169 .B \f[CB]\-\-serverid\f[R] \f[I]server\-id\f[R] 170 An optional unique ID for this debug server. 171 This is required if multiple debug servers are run on the same machine. 172 .RS 173 .RE 174 .SH OPTIONS FOR THE JINFO MODE 175 .TP 176 .B \f[CB]\-\-flags\f[R] 177 Prints the VM flags. 178 .RS 179 .RE 180 .TP 181 .B \f[CB]\-\-sysprops\f[R] 182 Prints the Java system properties. 183 .RS 184 .RE 185 .TP 186 .B no option 187 Prints the VM flags and the Java system properties. 188 .RS 189 .RE 190 .SH OPTIONS FOR THE JMAP MODE 191 .TP 192 .B no option 193 Prints the same information as Solaris \f[CB]pmap\f[R]. 194 .RS 195 .RE 196 .TP 197 .B \f[CB]\-\-heap\f[R] 198 Prints the \f[CB]java\f[R] heap summary. 199 .RS 200 .RE 201 .TP 202 .B \f[CB]\-\-binaryheap\f[R] 203 Dumps the \f[CB]java\f[R] heap in \f[CB]hprof\f[R] binary format. 204 .RS 205 .RE 206 .TP 207 .B \f[CB]\-\-dumpfile\f[R] \f[I]name\f[R] 208 The name of the dumpfile. 209 .RS 210 .RE 211 .TP 212 .B \f[CB]\-\-histo\f[R] 213 Prints the histogram of \f[CB]java\f[R] object heap. 214 .RS 215 .RE 216 .TP 217 .B \f[CB]\-\-clstats\f[R] 218 Prints the class loader statistics. 219 .RS 220 .RE 221 .TP 222 .B \f[CB]\-\-finalizerinfo\f[R] 223 Prints the information on objects awaiting finalization. 224 .RS 225 .RE 226 .SH OPTIONS FOR THE JSTACK MODE 227 .TP 228 .B \f[CB]\-\-locks\f[R] 229 Prints the \f[CB]java.util.concurrent\f[R] locks information. 230 .RS 231 .RE 232 .TP 233 .B \f[CB]\-\-mixed\f[R] 234 Attempts to print both \f[CB]java\f[R] and native frames if the platform 235 allows it. 236 .RS 237 .RE 238 .SH OPTIONS FOR THE JSNAP MODE 239 .TP 240 .B \f[CB]\-\-all\f[R] 241 Prints all performance counters. 242 .RS 243 .RE