{
    "mode": "man",
    "parameter": "jhat",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/jhat/1/json",
    "generated": "2026-10-23T19:48:00Z",
    "synopsis": "jhat [ options ] heap-dump-file\noptions\nThe command-line options. See Options.\nheap-dump-file\nJava  binary heap dump file to be browsed. For a dump file that contains multiple heap\ndumps, you can specify which dump in the file by appending #<number> to the file name,\nfor example, myfile.hprof#3.",
    "sections": {
        "NAME": {
            "content": "jhat - Analyzes the Java heap. This command is experimental and unsupported.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "jhat [ options ] heap-dump-file\n\n\noptions\nThe command-line options. See Options.\n\nheap-dump-file\nJava  binary heap dump file to be browsed. For a dump file that contains multiple heap\ndumps, you can specify which dump in the file by appending #<number> to the file name,\nfor example, myfile.hprof#3.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The jhat command parses a Java heap dump file and starts a web server. The jhat command  lets\nyou  to  browse  heap  dumps  with  your  favorite  web  browser.  The  jhat command supports\npredesigned queries such as show all instances of a known class  MyClass,  and  Object  Query\nLanguage  (OQL).  OQL  is  similar  to  SQL,  except  for querying heap dumps. Help on OQL is\navailable from the OQL help page shown by the jhat command. With the default port,  OQL  help\nis available at http://localhost:7000/oqlhelp/\n\nThere are several ways to generate a Java heap dump:\n\n• Use the jmap -dump option to obtain a heap dump at runtime. See jmap(1).\n\n• Use  the  jconsole option to obtain a heap dump through HotSpotDiagnosticMXBean at runtime.\nSee   jconsole(1)   and    the    HotSpotDiagnosticMXBean    interface    description    at\nhttp://docs.oracle.com/javase/8/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean.html\n\n• Heap   dump   is   generated   when   an  OutOfMemoryError  is  thrown  by  specifying  the\n-XX:+HeapDumpOnOutOfMemoryError Java Virtual Machine (JVM) option.\n\n• Use   the   hprof   command.   See   the   HPROF:   A   Heap/CPU    Profiling    Tool    at\nhttp://docs.oracle.com/javase/8/docs/technotes/samples/hprof.html\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "-stack false|true\nTurns off tracking object allocation call stack. If allocation site information is not\navailable  in  the  heap dump, then you have to set this flag to false. The default is\ntrue.\n\n-refs false|true\nTurns off tracking of references  to  objects.  Default  is  true.  By  default,  back\npointers,  which  are  objects  that  point to a specified object such as referrers or\nincoming references, are calculated for all objects in the heap.\n\n-port port-number\nSets the port for the jhat HTTP server. Default is 7000.\n\n-exclude exclude-file\nSpecifies a file that lists data members that should be excluded  from  the  reachable\nobjects  query.  For  example,  if  the  file lists java.lang.String.value, then, then\nwhenever the list of  objects  that  are  reachable  from  a  specific  object  o  are\ncalculated,   reference  paths  that  involve  java.lang.String.value  field  are  not\nconsidered.\n\n-baseline exclude-file\nSpecifies a baseline heap dump. Objects in both heap dumps with the same object ID are\nmarked as not being new. Other objects are marked as new. This is useful for comparing\ntwo different heap dumps.\n\n-debug int\nSets the debug level for this tool. A level of 0 means no  debug  output.  Set  higher\nvalues for more verbose modes.\n",
            "subsections": [
                {
                    "name": "-version",
                    "content": "Reports the release number and exits\n"
                },
                {
                    "name": "-h",
                    "content": "Dsiplays a help message and exits.\n",
                    "flag": "-h"
                },
                {
                    "name": "-help",
                    "content": "Displays a help message and exits.\n"
                },
                {
                    "name": "-J_flag_",
                    "content": "Passes  flag  to  the  Java  Virtual Machine on which the jhat command is running. For\nexample, -J-Xmx512m to use a maximum heap size of 512 MB.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "• jmap(1)\n\n• jconsole(1)\n\n• HPROF:            A            Heap/CPU            Profiling            Tool             at\nhttp://docs.oracle.com/javase/8/docs/technotes/samples/hprof.html\n\nJDK 8                                     21 November 2013                                   jhat(1)",
            "subsections": []
        }
    },
    "summary": "jhat - Analyzes the Java heap. This command is experimental and unsupported.",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Reports the release number and exits"
        },
        {
            "flag": "-h",
            "long": null,
            "arg": null,
            "description": "Dsiplays a help message and exits."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Displays a help message and exits."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Passes flag to the Java Virtual Machine on which the jhat command is running. For example, -J-Xmx512m to use a maximum heap size of 512 MB."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "jmap",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/jmap/1/json"
        },
        {
            "name": "jconsole",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/jconsole/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Java heap analysis tool.",
        "examples": [
            {
                "description": "Analyze a heap dump (from `jmap`), view via HTTP on port 7000",
                "command": "jhat {{dump_file.bin}}"
            },
            {
                "description": "Analyze a heap dump, specifying an alternate port for the HTTP server",
                "command": "jhat {{-p|-port}} {{port}} {{dump_file.bin}}"
            },
            {
                "description": "Analyze a dump letting `jhat` use up to 8 GB RAM (2-4x dump size recommended)",
                "command": "jhat -J-mx8G {{dump_file.bin}}"
            }
        ]
    }
}