Java virtual machine performance monitoring and troubleshooting tools, virtual machine troubleshooting

Source: Internet
Author: User

Java virtual machine performance monitoring and troubleshooting tools, virtual machine troubleshooting

1. jdk command line tool

1) jps: Virtual Machine Process status Tool

Jps [option] [hostid]

Main parameters:

2) jstat: Virtual Machine statistics monitoring tool

Jstat-<option> [-t] [-h <lines>] <vmid> [<interval> [<count>]

Main parameters:

 

For example, if the gc information of process 8675 is queried twice every 8675 ms, jstat-gc 1000 2

 

 

3) jinfo: Java configuration information tool

Allows you to view and modify VM parameters in real time.

Usage:

Jinfo [option] <pid>

(To connect to running process)

Jinfo [option] <executable <core>

(To connect to a core file)

Jinfo [option] [server_id @] <remote server IP or hostname>

(To connect to remote debug server)

For example, query the maximum allocable size of the new generation memory in the Java heap area of the VM.

 

 

4) jmap: Java memory image tool

Usage:

Jmap [option] <pid>

(To connect to running process)

Jmap [option] <executable <core>

(To connect to a core file)

Jmap [option] [server_id @] <remote server IP or hostname>

(To connect to remote debug server)

Common parameters:

 

Example:

 

 

5) jhat: Virtual Machine heap dump snapshot analysis tool

The built-in http server can be used to analyze dump files generated by jmap.

For example:

Access http: // 192.168.10.92: 7007/

 

 

6) jstack: generate the thread snapshot (threaddump or javacore file) at the current time of the VM ).

Usage:

Jstack [-l] <pid>

(To connect to running process)

Jstack-F [-m] [-l] <pid>

(To connect to a hung process)

Jstack [-m] [-l] <executable> <core>

(To connect to a core file)

Jstack [-m] [-l] [server_id @] <remote server IP or hostname>

(To connect to a remote debug server)

Main parameters:

 

7) hsdis: Code disassembly generated by JIT

2. visualization tools

Jconsole and visualvm (omitted)

 

References

Deep understanding of Java Virtual Machine: JVM advanced features and best practices (version 2nd)

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.