JHSDB(1)
π JHSDB β the Java HotSpot Debugger, bestie edition π
Okay so real talk, jhsdb is that girl. She's the JDK command that lets you 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). Like, she's doing the most forensic work and we're literally obsessed. π΅οΈββοΈβ¨
β¨ SYNOPSIS β¨
jhsdb clhsdb [--pid pid | --exe executable --core coredump]
jhsdb hsdb [--pid pid | --exe executable --core coredump]
jhsdb debugd (--pid pid | --exe executable --core coredump) [options]
jhsdb jstack (--pid pid | --exe executable --core coredump | --connect
[server-id@]debugd-host) [options]
jhsdb jmap (--pid pid | --exe executable --core coredump | --connect
[server-id@]debugd-host) [options]
jhsdb jinfo (--pid pid | --exe executable --core coredump | --connect
[server-id@]debugd-host) [options]
jhsdb jsnap (--pid pid | --exe executable --core coredump | --connect
[server-id@]debugd-host) [options]
- pid β the process ID
jhsdbshould attach to. It has to be a Java process, no cap. Want a list of Java processes running on a machine? Use thepscommand, or if the JVM processes aren't running in a separate docker instance, use thejpscommand. - executable β the Java executable file from which the core dump was produced.
- coredump β the core file
jhsdbshould attach to. - [server-id@]debugd-host β an optional server ID and the address of the remote debug server (
debugd). - options β the command-line options for a
jhsdbmode. See Options for thedebugdMode, Options for thejstackMode, Options for thejmapMode, Options for thejinfoMode, and Options for thejsnapMode.
Note, bestie: Either thepidor the pair ofexecutableandcorefiles or the[server-id@]debugd-hostmust be provided fordebugd,jstack,jmap,jinfoandjsnapmodes. Like, you can't just show up empty-handed. π«Ά
πΈ DESCRIPTION πΈ
You can use the jhsdb 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. So she's giving β¨experimentalβ¨, not officially supported, but still iconic.
Huge warning, seriously: Attaching the jhsdb tool to a live process will cause the process to hang and the process will probably crash when the debugger detaches. π Like, do not do this casually, I'm begging.
The jhsdb tool can be launched in any one of the following modes:
jhsdb clhsdbβ starts the interactive command-line debugger.jhsdb hsdbβ starts the interactive GUI debugger.jhsdb debugdβ starts the remote debug server.jhsdb jstackβ prints stack and locks information.jhsdb jmapβ prints heap information.jhsdb jinfoβ prints basic JVM information.jhsdb jsnapβ prints performance counter information.jhsdbcommand--helpβ displays the options available for the command.
π OPTIONS FOR THE DEBUGD MODE π
--serveridserver-id β an optional unique ID for this debug server. This is required if multiple debug servers are run on the same machine.--rmiportport β sets the port number to which the RMI connector is bound. If not specified, a random available port is used.--registryportport β sets the RMI registry port. This option overrides the system propertysun.jvm.hotspot.rmi.port. If not specified, the system property is used. If the system property is not set, the default port1099is used.--hostnamehostname β sets the hostname the RMI connector is bound. The value could be a hostname or an IPv4/IPv6 address. This option overrides the system propertyjava.rmi.server.hostname. 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 π§
--flagsβ prints the VM flags.--syspropsβ prints the Java system properties.- no option β prints the VM flags and the Java system properties, both of them. She's thorough. π
π¦ OPTIONS FOR THE JMAP MODE π¦
- no option β prints the same information as Solaris
pmap. --heapβ prints the java heap summary.--binaryheapβ dumps the java heap in hprof binary format.--dumpfilename β the name of the dumpfile.--histoβ prints the histogram of java object heap.--clstatsβ prints the class loader statistics.--finalizerinfoβ prints the information on objects awaiting finalization.
π₯ OPTIONS FOR THE JSTACK MODE π₯
--locksβ prints thejava.util.concurrentlocks information.--mixedβ attempts to print both java and native frames if the platform allows it.
π OPTIONS FOR THE JSNAP MODE π
--allβ prints all performance counters.
Okay bestie, that's the whole jhsdb manual, every last option and warning, no cap. Go forth and debug responsibly (and maybe don't attach to live processes unless you're ready for chaos π). Stay iconic, stay supported-by-your-own-decisions, and remember: experimental tools are literally the main character energy of the JDK. πβ¨
Brought to you by JDK 21 and the year 2023 β like, this manual is firmly in its era. π
π¦ where this page comes from
- arch rolling: jdk21-openjdk 21.0.13.0.3.u1-1 Β· LicenseRef-Java
- Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms