{
    "mode": "man",
    "parameter": "jstack",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/jstack/1/json",
    "generated": "2026-06-02T22:31:29Z",
    "synopsis": "jstack [ options ] pid\njstack [ options ] executable core\njstack [ options ] [ server-id@ ] remote-hostname-or-IP\noptions\nThe command-line options. See Options.\npid    The process ID for which the stack trace is printed. The process must be a Java\nprocess. To get a list of Java processes running on a machine, use the jps(1) command.\nexecutable\nThe Java executable from which the core dump was produced.\ncore   The core file for which the stack trace is to be printed.\nremote-hostname-or-IP\nThe remote debug server hostname or IP address. See jsadebugd(1).\nserver-id\nAn optional unique ID to use when multiple debug servers are running on the same\nremote host.",
    "sections": {
        "NAME": {
            "content": "jstack - Prints Java thread stack traces for a Java process, core file, or remote debug\nserver. This command is experimental and unsupported.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "jstack [ options ] pid\n\njstack [ options ] executable core\n\njstack [ options ] [ server-id@ ] remote-hostname-or-IP\n\n\noptions\nThe command-line options. See Options.\n\npid    The process ID for which the stack trace is printed. The process must be a Java\nprocess. To get a list of Java processes running on a machine, use the jps(1) command.\n\nexecutable\nThe Java executable from which the core dump was produced.\n\ncore   The core file for which the stack trace is to be printed.\n\nremote-hostname-or-IP\nThe remote debug server hostname or IP address. See jsadebugd(1).\n\nserver-id\nAn optional unique ID to use when multiple debug servers are running on the same\nremote host.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The jstack command prints Java stack traces of Java threads for a specified Java process,\ncore file, or remote debug server. For each Java frame, the full class name, method name,\nbyte code index (BCI), and line number, when available, are printed. With the -m option, the\njstack command prints both Java and native frames of all threads with the program counter\n(PC). For each native frame, the closest native symbol to PC, when available, is printed. C++\nmangled names are not demangled. To demangle C++ names, the output of this command can be\npiped to c++filt. When the specified process is running on a 64-bit Java Virtual Machine, you\nmight need to specify the -J-d64 option, for example: jstack -J-d64 -m pid.\n\nNote: This utility is unsupported and might not be available in future release of the JDK. In\nWindows Systems where the dbgeng.dll file is not present, Debugging Tools For Windows must be\ninstalled so these tools work. The PATH environment variable needs to contain the location of\nthe jvm.dll that is used by the target process, or the location from which the crash dump\nfile was produced. For example:\n",
            "subsections": [
                {
                    "name": "set PATH=<jdk>\\jre\\bin\\client;%PATH%",
                    "content": ""
                }
            ]
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-F",
                    "content": "Force a stack dump when jstack [-l] pid does not respond.\n",
                    "flag": "-F"
                },
                {
                    "name": "-l",
                    "content": "Long listing. Prints additional information about locks such as a list of owned\njava.util.concurrent ownable synchronizers. See the AbstractOwnableSynchronizer class\ndescription at\nhttp://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer.html\n",
                    "flag": "-l"
                },
                {
                    "name": "-m",
                    "content": "Prints a mixed mode stack trace that has both Java and native C/C++ frames.\n",
                    "flag": "-m"
                },
                {
                    "name": "-h",
                    "content": "Prints a help message.\n",
                    "flag": "-h"
                },
                {
                    "name": "-help",
                    "content": "Prints a help message.\n"
                }
            ]
        },
        "KNOWN BUGS": {
            "content": "In mixed mode stack trace, the -m option does not work with the remote debug server.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "• pstack(1)\n\n• C++filt(1)\n\n• jps(1)\n\n• jsadebugd(1)\n\n\n\nJDK 8                                     21 November 2013                                 jstack(1)",
            "subsections": []
        }
    },
    "summary": "jstack - Prints Java thread stack traces for a Java process, core file, or remote debug server. This command is experimental and unsupported.",
    "flags": [
        {
            "flag": "-F",
            "long": null,
            "arg": null,
            "description": "Force a stack dump when jstack [-l] pid does not respond."
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "Long listing. Prints additional information about locks such as a list of owned java.util.concurrent ownable synchronizers. See the AbstractOwnableSynchronizer class description at http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer.html"
        },
        {
            "flag": "-m",
            "long": null,
            "arg": null,
            "description": "Prints a mixed mode stack trace that has both Java and native C/C++ frames."
        },
        {
            "flag": "-h",
            "long": null,
            "arg": null,
            "description": "Prints a help message."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Prints a help message."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "pstack",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pstack/1/json"
        },
        {
            "name": "filt",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/filt/1/json"
        },
        {
            "name": "jps",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/jps/1/json"
        },
        {
            "name": "jsadebugd",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/jsadebugd/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Java stack trace tool.",
        "examples": [
            {
                "description": "Print Java stack traces for all threads in a Java process",
                "command": "jstack {{java_pid}}"
            },
            {
                "description": "Print mixed mode (Java/C++) stack traces for all threads in a Java process",
                "command": "jstack -m {{java_pid}}"
            },
            {
                "description": "Print stack traces from Java core dump",
                "command": "jstack {{/usr/bin/java}} {{file.core}}"
            }
        ]
    }
}