JHSDB(1)

πŸ“¦ version 21.0.12.1.1, in centos-stream 10

πŸ’… 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 jhsdb should attach to. It has to be a Java process, no cap. Want a list of Java processes running on a machine? Use the ps command, or if the JVM processes aren't running in a separate docker instance, use the jps command.
  • executable β€” the Java executable file from which the core dump was produced.
  • coredump β€” the core file jhsdb should 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 jhsdb mode. 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.
Note, bestie: Either the pid or the pair of executable and core files or the [server-id@]debugd-host must be provided for debugd, jstack, jmap, jinfo and jsnap modes. 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.
  • jhsdb command --help β€” displays the options available for the command.

πŸŽ€ OPTIONS FOR THE DEBUGD MODE πŸŽ€

  • --serverid server-id β€” an optional unique ID for this debug server. This is required if multiple debug servers are run on the same machine.
  • --rmiport port β€” sets the port number to which the RMI connector is bound. If not specified, a random available port is used.
  • --registryport port β€” sets the RMI registry port. This option overrides the system property sun.jvm.hotspot.rmi.port. If not specified, the system property is used. If the system property is not set, the default port 1099 is used.
  • --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 property java.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.
  • --dumpfile name β€” 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 the java.util.concurrent locks 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
  • centos-stream 10: java-21-openjdk-devel-fastdebug 1:21.0.12.1.1-2.1.el10 Β· ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms