Jstack command (Java Stack Trace)

Source: Internet
Author: User
Tags stack trace

1. Introduction

Jstack is used to print out the Java stack information for a given Java process ID or core file or remote debugging service, and if it is on a 64-bit machine, the option "-J-D64" needs to be specified, and the Jstack usage of Windows only supports the following way:

Jstack [-l] PID

If a Java program crashes generating a core file, the Jstack tool can be used to obtain information about the core file's Java stack and the native stack, making it easy to know how the Java program crashes and where the problem occurs in the program. In addition, the Jstack tool can be attached to a running Java program to see the Java stack and the native stack of the Java program that was running, and jstack is useful if the Java program that is running now renders hung state.

2. Command format
jstack [option] pid
jstack [option] executable core
jstack [option] [[Email Protected]]remote-hostname-or-ip

3. Common parameter description

1), Options:

Executable Java executable from which, the core dump was produced.

(Probably the Java executable that generated the core dump)

Core dump file that will be printed with the information

Remote-hostname-or-ip the host name or IP of the Remote Debug service

Server-id Unique ID, if multiple Remote debug services on a single host

2), Basic parameters:

-F when ' jstack [-l] PID ' does not have a corresponding time to force the printing stack information

-L long list. Prints additional information about the lock, such as the ownable synchronizers list belonging to Java.util.concurrent.

-M prints all of the stack information for Java and Native/C + + frameworks.

-H | -help Printing Help information

The PID requires the Java process ID of the configuration information to be printed and can be queried with JPS.

4. Examples of Use

Jstack command (Java Stack Trace)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.