jhat(1)

πŸ“¦ version 8.504.u01, in arch rolling

🌸 NAME 🌸

jhat β€” bestie, this one analyzes the Java heap πŸ’– and heads up: this command is experimental and unsupported, so it's giving "use at your own risk, no cap" energy πŸ‘€


✨ SYNOPSIS ✨

jhat [ options ] heap-dump-file
  • options β€” the command-line options, obvi. Peep the OPTIONS section below πŸ’…
  • heap-dump-file β€” the Java binary heap dump file you wanna browse, periodt. If your dump file has multiple heap dumps stuffed in it, you can say which one you want by slapping #<number> on the end of the file name, like myfile.hprof#3 πŸŽ€

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so jhat parses a Java heap dump file and then starts a web server ✨ Which means yes bestie, you get to browse your heap dumps with your favorite web browser, no fancy tooling required, we love an accessible queen πŸ‘‘

It supports predesigned queries β€” like showing all instances of a known class, e.g. MyClass β€” plus Object Query Language (OQL). OQL is basically SQL's cousin, except it queries heap dumps instead of databases, iykyk 🧚 Help on OQL lives right there on the OQL help page that jhat shows you. With the default port, that OQL help is at http://localhost:7000/oqlhelp/ 🌈


🌟 So how do you even make a Java heap dump? 🌟

There are several ways, bestie, and I'm listing all of them πŸ’œ


πŸ’… OPTIONS πŸ’…

  • -stack false|true β€” turns off tracking of the object allocation call stack. If the allocation site info isn't available in the heap dump, then you have to set this flag to false, no wiggle room bestie. Default is true 🫢
  • -refs false|true β€” turns off tracking of references to objects. Default is true. By default, back pointers (those are objects pointing at a specified object β€” think referrers, aka incoming references) get calculated for every single object in the heap πŸ’–
  • -port port-number β€” sets the port for the jhat HTTP server. Default is 7000 ✨
  • -exclude exclude-file β€” points at a file that lists data members that should be excluded from the reachable objects query. Like, say the file lists java.lang.String.value β€” then, then whenever the list of objects reachable from a specific object o gets calculated, reference paths that involve the java.lang.String.value field are just... not considered πŸ™ˆ
  • -baseline exclude-file β€” specifies a baseline heap dump. Objects in both heap dumps that share the same object ID get marked as not new. Everything else gets marked as new. Super handy for comparing two different heap dumps, chef's kiss πŸ‘‘
  • -debug int β€” sets the debug level for this tool. A level of 0 means no debug output at all. Crank it higher for more verbose modes πŸ“
  • -version β€” reports the release number and exits, short and sweet ⭐
  • -h β€” Dsiplays a help message and exits πŸ’€ (yes it says "Dsiplays", I am simply reporting the vibes as they are)
  • -help β€” displays a help message and exits 🌸
  • -Jflag β€” passes flag to the Java Virtual Machine that jhat is running on. For example, -J-Xmx512m to use a maximum heap size of 512 MB πŸ’œ

🌈 SEE ALSO 🌈


okay that's the whole page bestie, you're officially a heap-dump-browsing legend πŸ’– This one's straight outta JDK 8, dated 21 November 2013 β€” a true vintage icon, slay πŸŽ€βœ¨πŸ‘‘

πŸ“¦ where this page comes from
  • arch rolling: jdk8-openjdk 8.504.u01-1 Β· LicenseRef-Java
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms