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