java性能监控工具jcmd-windows

jcmd

Sends diagnostic command requests to a running Java Virtual Machine (JVM).

Synopsis

jcmd [-l|-h|-help]

jcmd pid|main-class PerfCounter.print

jcmd pid|main-class -f filename

jcmd pid|main-class commandarguments]

Description

The jcmd utility is used to send diagnostic command requests to the JVM. It must be used on the same machine on which the JVM is running, and have the same effective user and group identifiers that were used to launch the JVM.


Note:

To invoke diagnostic commands from a remote machine or with different identifiers, you can use the com.sun.management.DiagnosticCommandMBean interface. For more information about theDiagnosticCommandMBean interface, see the API documentation athttp://docs.oracle.com/javase/8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean.html

If you run jcmd without arguments or with the -l option, it prints the list of running Java process identifiers with the main class and command-line arguments that were used to launch the process. Running jcmd with the -h or -help option prints the tool‘s help message.


Note:

The jcmd utility can be used to dynamically interact with Java Flight Recorder (JFR) in a JVM that is already running. You can use it to unlock commercial features, enable/start/stop flight recordings, and obtain various status messages from the system. For a list of examples, see the Java Flight Recorder Runtime Guide at http://docs.oracle.com/javacomponents/jmc.htm

If you specify the processes identifier (pid) or the main class (main-class) as the first argument, jcmd sends the diagnostic command request to the Java process with the specified identifier or to all Java processes with the specified name of the main class. You can also send the diagnostic command request to all available Java processes by specifying 0 as the process identifier. Use one of the following as the diagnostic command request:

Perfcounter.print

Prints the performance counters available for the specified Java process. The list of performance counters might vary with the Java process.

-f filename

The name of the file from which to read diagnostic commands and send them to the specified Java process. Used only with the -f option. Each command in the file must be written on a single line. Lines starting with a number sign (#) are ignored. Processing of the file ends when all lines have been read or when a line containing the stop keyword is read.

command [arguments]

The command to be sent to the specified Java process. The list of available diagnostic commands for a given process can be obtained by sending the help command to this process. Each diagnostic command has its own set of arguments. To see the description, syntax, and a list of available arguments for a command, use the name of the command as the argument for the help command.

Note: If any arguments contain spaces, you must surround them with single or double quotation marks ( or "). In addition, you must escape single or double quotation marks with a backslash (\) to prevent the operating system shell from processing quotation marks. Alternatively, you can surround these arguments with single quotation marks and then with double quotation marks (or with double quotation marks and then with single quotation marks).

Options

Options are mutually exclusive.

-f filename

Reads commands from the specified file. This option can be used only if you specify the process identifier or the main class as the first argument. Each command in the file must be written on a single line. Lines starting with a number sign (#) are ignored. Processing of the file ends when all lines have been read or when a line containing the stop keyword is read.

-h
-help

Prints a help message.

-l

Prints the list of running Java processes identifiers with the main class and command-line arguments.

时间: 2024-10-16 01:48:37

java性能监控工具jcmd-windows的相关文章

Java性能监控工具:VisualVM

VisualVM是一款免费的,集成了多个 JDK 命令行工具的可视化工具,它能为您提供强大的分析能力,对 Java 应用程序做性能分析和调优.这些功能包括生成和分析海量数据.跟踪内存泄漏.监控垃圾回收器.执行内存和 CPU 分析,同时它还支持在 MBeans 上进行浏览和操作.本文主要介绍如何使用 VisualVM (JVM 监控)进行性能分析及调优. 自从 JDK 6 Update 7 以后已经作为 Oracle JDK 的一部分,位于 JDK 根目录的 bin 文件夹下,无需安装,直接运行即

java性能监控工具jconsole-windows

jconsole Starts a graphical console that lets you monitor and manage Java applications. Synopsis jconsole [ options ] [ connection ... ] options The command-line options. See Options. connection = pid | host:port | jmxURL The pid value is the process

java性能监控工具jconsole-linux

jconsole Starts a graphical console that lets you monitor and manage Java applications. Synopsis jconsole [ options ] [ connection ... ] options The command-line options. See Options. connection = pid | host:port | jmxURL The pid value is the process

java性能监控工具jstat-linux

jstat Monitors Java Virtual Machine (JVM) statistics. This command is experimental and unsupported. Synopsis jstat [ generalOption | outputOptions vmid [ interval[s|ms] [ count ] ] generalOption A single general command-line option -help or -options.

java性能监控工具jcmd-linux

jcmd Sends diagnostic command requests to a running Java Virtual Machine (JVM). Synopsis jcmd [-l|-h|-help] jcmd pid|main-class PerfCounter.print jcmd pid|main-class -f filename jcmd pid|main-class command[ arguments] Description The jcmd utility is

java性能监控工具jstat

jstat Monitors Java Virtual Machine (JVM) statistics. This command is experimental and unsupported. Synopsis jstat [ generalOption | outputOptions vmid [ interval[s|ms] [ count ] ] generalOption A single general command-line option -help or -options.

java性能监控工具

1.问题 OutOfMemoryError: 内存不足: 内存泄漏 线程死锁 锁竞争(Lock Contention) java消耗过多的CPU 2.java常用健康工具 jps (java virtual machine process status tool)  监控jvm进程状态信息 使用格式: jps [options] [hostid] -m: 输出传入main方法的参数 -l: 显示main类或jar的完全限定名称 -v: 显示为jvm虚拟机指定的参数 jstack: 查看某个jav

关于 Java 性能监控您不知道的 5 件事,第 1 部分

责怪糟糕的代码(或不良代码对象)并不能帮助您发现瓶颈,提高 Java? 应用程序速度,猜测也不能帮您解决.Ted Neward 引导您关注 Java 性能监控工具,从5 个技巧开始,使用Java 5 的内置分析器JConsole 收集和分析性能数据. 当应用程序性能受到损害时,大多数开发人员都惊慌失措,这在情理之中.跟踪 Java 应用程序瓶颈来源一直以来都是很麻烦的,因为 Java 虚拟机有黑盒效应,而且 Java 平台分析工具一贯就有缺陷. 然而,随着 Java 5 中 JConsole 的

Java 性能分析工具 , 第 2 部分:Java 内置监控工具

引言 本文为 Java 性能分析工具系列文章第二篇,第一篇:操作系统工具.在本文中将介绍如何使用 Java 内置监控工具更加深入的了解 Java 应用程序和 JVM 本身.在 JDK 中有许多内置的工具,其中包括: jcmd:打印一个 Java 进程的类,线程以及虚拟机信息.适合用在脚本中.使用 jcmd - h 来查看使用方法. jconsole:提供 JVM 活动的图形化展示,包括线程使用,类使用以及垃圾回收(GC)信息. jhat:帮助分析内存堆存储. jmap:提供 JVM 内存使用信息