JHSDB(1)

πŸ“¦ version 23.0.2.0, in opensuse-leap 16.0

πŸ’… JHSDB(1) β€” the JDK Commands girlies' guide to jhsdb

okay so bestie, welcome to jhsdb, straight out of the JDK Commands section of the manual. Yes, the title line up top said JHSDB(1) and the section was JDK Commands β€” consider yourself formally introduced ✨

🌸 NAME 🌸

jhsdb β€” it attaches to a Java process, or launches a postmortem debugger to analyze the content of a core dump from a crashed Java Virtual Machine (JVM). literally its whole personality πŸ’€

πŸŽ€ SYNOPSIS πŸŽ€

like, here's the whole fit sheet, no cap:

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 the little arguments, expained with love 🫢

  • pid β€” the process ID the jhsdb tool should attach to. the process must be a Java process, okay? to get 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 β€” the jps command πŸ‘‘
  • executable β€” the Java executable file from which the core dump was produced.
  • coredump β€” the core file the jhsdb tool should attach to.
  • [server-id@]debugd-host β€” an optional server ID plus 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. it's giving menu, honestly πŸ“
Note: 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. no pick-one-and-ghost, bestie. pick something. πŸ™ˆ

πŸ¦‹ 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). πŸ’–

🚨 but listen β€” this command is experimental and unsupported. main character energy, zero warranty.
Note: attaching the jhsdb tool to a live process will cause the process to hang, and the process will probably crash when the debugger detaches. not a vibe check you want to fail, ngl 😭

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. the "help me help you" of it all ✨

πŸ”₯ 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. sharing is not caring here, bestie πŸ’…
  • --rmiport port β€” sets the port number to which the RMI connector is bound. if not specified, a random available port is used. lucky dip πŸŽ€
  • --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. three-layer backup plan, we love to see it πŸ‘‘
  • --hostname hostname β€” sets the hostname the RMI connector is bound to. 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. same energy, different property πŸ’œ

🌈 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. doing both, because why choose 😌

🧚 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. waiting room behavior 🫢

⭐ 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. attempts. icon behavior, sometimes it just can't 😭

πŸ’€ OPTIONS FOR THE JSNAP MODE πŸ’€

  • --all β€” prints all performance counters. all of them. the full collection. periodt πŸ’…

and that's the whole page, bestie β€” go forth and debug responsibly 🌸

🌷 okay so that's a wrap, mwah πŸ’– β€” this little love letter came straight from JDK 23, dated 2024, and the manual page it lives in is JHSDB(1). iykyk πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from