LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

jhat

java Heap Analysis Tool

TLDR

Analyze heap dump
$ jhat [dump.hprof]
copy
Use custom port
$ jhat -port [8080] [dump.hprof]
copy
Analyze with increased memory
$ jhat -J-Xmx8G [dump.hprof]
copy
Compare with baseline
$ jhat -baseline [old.hprof] [new.hprof]
copy
Analyze specific dump in multi-dump file
$ jhat [file.hprof#2]
copy

SYNOPSIS

jhat [options] heap-dump-file

DESCRIPTION

jhat is the Java Heap Analysis Tool. It parses Java heap dump files (in HPROF format) and launches an HTTP web server for browsing heap contents interactively. Supports pre-designed queries and OQL (Object Query Language) for custom analysis. Access the web interface at http://localhost:7000 by default.

PARAMETERS

-port port

HTTP server port (default 7000).
-baseline file
Baseline dump for comparison.
-stack boolean
Track allocation call stacks.
-refs boolean
Track object references.
-debug int
Set debug level. 0 means no debug output. 1 parses hprof file. 2 parses hprof file without starting server.
-exclude file
Exclude data members listed in file from reachability queries.
-version
Report version number and exit.
-Jflag
Pass flag to JVM (e.g., -J-Xmx8G).

CAVEATS

Removed since JDK 9 (JEP 241). Use VisualVM, Eclipse MAT, or other heap analyzers instead. Only available in JDK 6, 7, and 8.

SEE ALSO

jmap(1), jstack(1), jps(1)

Copied to clipboard
Kai