JHSDB(1)
π JHSDB(1) β the manual, but make it make sense π
Okay so bestie, this is the jhsdb command, and it's from the JDK (specifically JDK 22, dated 2024, but we'll get to that later). Think of this as your ultimate cheat sheet for attaching to Java processes and doing postmortem detective work on crashed JVMs. Periodt.
β¨ 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 πΈ
Okay so here's the deal, these are all the ways you can call this tool:
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]
And here's what all those bits mean, explained like your bestie would:
pidβ The process ID to which thejhsdbtool should attach. Lowkey important: the process must be a Java process, no cap. To get a list of Java processes running on a machine, use thepscommand or, if the JVM processes are not running in a separate docker instance, thejpscommand. π»β¨executableβ The Java executable file from which the core dump was produced. Basically, which Java was running when things went π.coredumpβ The core file to which thejhsdbtool should attach. It's giving forensic evidence at the scene. π΅οΈββοΈ[server-id@]debugd-hostβ An optional server ID and the address of the remote debug server (debugd). Like, if you're connecting to your friend's debug server, you use this.optionsβ The command-line options for ajhsdbmode. See Options for the debugd Mode, Options for the jstack Mode, Options for the jmap Mode, Options for the jinfo Mode, and Options for the jsnap Mode below. π
Note, bestie: Either thepidor the pair ofexecutableandcorefiles or the[server-id@]debugd-hostmust be provided fordebugd,jstack,jmap,jinfoandjsnapmodes. No exceptions, fr fr. π ββοΈ
π¦ DESCRIPTION π¦
So 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, which honestly is giving "use at your own risk" energy. π§ͺβ¨
Warning warning warning! π¨ Attaching the jhsdb tool to a live process will cause the process to hang and the process will probably crash when the debugger detaches. This is not a drill, bestie. It's literally in the manual. Don't say I didn't warn you. ππ
The jhsdb tool can be launched in any one of the following modes:
jhsdb clhsdbβ Starts the interactive command-line debugger. Old school but slaps.jhsdb hsdbβ Starts the interactive GUI debugger. For when you want vibes AND visuals. π₯οΈβ¨jhsdb debugdβ Starts the remote debug server. The main character of remote debugging. πjhsdb jstackβ Prints stack and locks information. Like a little snapshot of what's going on. πΈjhsdb jmapβ Prints heap information. All the memory tea. βjhsdb jinfoβ Prints basic JVM information. The essentials, no fluff.jhsdb jsnapβ Prints performance counter information. Numbers that go brrr. πjhsdb command --helpβ Displays the options available for the command. When in doubt, ask for help. πββοΈ
π OPTIONS FOR THE DEBUGD MODE π
Okay so debugd is the remote debug server mode, and here are all the flags you can use with it:
--serverid server-idβ An optional unique ID for this debug server. This is required if multiple debug servers are run on the same machine. So like, if you've got multiple servers, you gotta give them names so they don't get confused. π·οΈ--rmiport portβ Sets the port number to which the RMI connector is bound. If not specified, a random available port is used. Slay, it picks for you. π²--registryport portβ 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. So there's a whole hierarchy of who decides, and this flag is the boss. π--hostname hostnameβ 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. Again, hierarchy. The more you know. π
π OPTIONS FOR THE JINFO MODE π
jinfo is like the info-dump mode, and here's what you can ask for:
--flagsβ Prints the VM flags. All the settings. π©--syspropsβ Prints the Java system properties. The system tea. βno optionβ Prints the VM flags and the Java system properties. Both. Together. Iconic. β¨
β OPTIONS FOR THE JMAP MODE β
jmap is all about the heap, bestie. Here are your options:
no optionβ Prints the same information as Solarispmap. Old school reference, but okay. πΊοΈ--heapβ Prints the java heap summary. The TL;DR of your heap. π--binaryheapβ Dumps the java heap in hprof binary format. For when you need the raw data. πΎ--dumpfile nameβ The name of the dumpfile. Name your dump, bestie. π·οΈ--histoβ Prints the histogram of java object heap. A little chart of what's taking up space. π--clstatsβ Prints the class loader statistics. All the class loader numbers. π--finalizerinfoβ Prints the information on objects awaiting finalization. The objects in limbo. π»
π OPTIONS FOR THE JSTACK MODE π
jstack is for stack and lock info, and here's what you can toggle:
--locksβ Prints thejava.util.concurrentlocks information. Lock talk. π--mixedβ Attempts to print both java and native frames if the platform allows it. Best of both worlds, if your platform is cool with it. π€
π§ OPTIONS FOR THE JSNAP MODE π§
jsnap is the performance counter mode, and it's simple:
--allβ Prints all performance counters. All of them. No filter. π
And that's the whole vibe, bestie. This iconic manual page is from JDK 22, dated 2024, and it's literally the moment for anyone doing JVM detective work. Go forth and debug responsibly. πβ¨π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: java-22-openjdk-devel 22.0.2.0-160000.1.1 Β· Apache-1.1 AND Apache-2.0 AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-only WITH Classpath-exception-2.0 AND LGPL-2.0-only AND MPL-1.0 AND MPL-1.1 AND SUSE-Public-Domain AND W3C
- opensuse-leap 16.0: java-22-openjdk-devel 22.0.2.0-160000.1.1 Β· Apache-1.1 AND Apache-2.0 AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-only WITH Classpath-exception-2.0 AND LGPL-2.0-only AND MPL-1.0 AND MPL-1.1 AND SUSE-Public-Domain AND W3C
- opensuse-leap 16.0: java-22-openjdk-devel 22.0.2.0-160000.1.1 Β· Apache-1.1 AND Apache-2.0 AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-only WITH Classpath-exception-2.0 AND LGPL-2.0-only AND MPL-1.0 AND MPL-1.1 AND SUSE-Public-Domain AND W3C
- 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