Jcmd command, jcmd command

Source: Internet
Author: User

Jcmd command, jcmd command
Overview

After JDK 1.7, a command line tool jcmd is added. It is a multi-function tool that can be used to export heap, view java processes, export thread information, and execute GC.

Example

The following command lists all running virtual machines:

The-l parameter lists all Java virtual machines. For each virtual machine, you can use the help command to list all commands supported by the virtual machine, as shown in. Take the process 21024 as an example:

View VM startup time VM. uptime

Print Thread stack information Thread. print

View the class statistics in the system. GC. class_histogram

Run the following command:

[Qifuguang @ Mac ~] $ Jcmd 21024 GC. class_histogram

The result is as follows:

Export heap information GC. heap_dump

Use the following command to export the current stack information: this command function and jmap-dump
Same functions

Get System Properties content VM. system_properties

Obtain the startup parameter VM. flags

Obtain all performance-related data: PerfCounter. print

Summary

As shown in the preceding example, jcmd has most of jmap functions, and Oracle officially recommends using jcmd instead of jmap.

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.