Jstack command (java stack trace)

Source: Internet
Author: User

 

JDK built-in tools

I. javah command (C header and stub file generator)

Ii. JPs command (Java Virtual Machine Process status tool)

3. jstack command (java stack trace)

4. jstat command (Java Virtual Machine statistics monitoring tool)

V. jmap command (Java memory map)

6. jinfo command (Java configuration info)

VII. jconsole command (Java Monitoring and Management Console)

8. jvisualvm commands (Java Virtual Machine Monitoring, troubleshooting, and profiling tool)

9. jhat command (Java heap analyse tool)

10. jdb command (the Java debugger)

1. Introduction

Jstack is used to print the java stack information for a given JAVA process ID or core file or remote debugging service, if it is on a 64-bit machine, you need to specify the option "-J-d64 ", windows jstack only supports the following methods:

Jstack [-L] PID

If the Java program crashes to generate a core file, the jstack tool can be used to obtain information about the java stack and native stack of the core file, this allows you to easily understand how Java programs crash and where problems occur. In addition, the jstack tool can be attached to a running Java program to view the information of the java stack and native stack of the currently running Java program, if the currently running Java program is hung, jstack is very useful.

2. Command Format
Jstack [Option] PID
Jstack [Option] executable Core
Jstack [Option] [server-ID @] Remote-hostname-or-IP

3. Common Parameters

1) Options:

Executable Java executable from which the core dump was produced.

(It may be a Java executable program that generates core dump)

Core dump file where information will be printed

Remote-hostname-or-IP remote debug service host name or IP address

The unique server-ID. If Multiple Remote debug services exist on one host

2) Basic parameters:

-F forcibly print stack information when 'jstack [-L] PID 'does not match

-L long list. print additional information about the lock, for example, ownable synchronizers list belonging to Java. util. concurrent.

-M prints all stack information of Java and native C/C ++ frameworks.

-H |-help: Print help information

The ID of the Java Process whose PID needs to be printed. You can use JPs to query the configuration information.

4. Example

This article is from:Feng Libin's blog

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.