jcmd的简单实用
命令jcmd
显示所有java进程id及相关信息
命令 jcmd java_pid help
显示某个java进程的所有可用命令
➜ jobs jcmd 61185 help
61185:
The following commands are available:
JFR.stop
JFR.start
JFR.dump
JFR.check
VM.native_memory
VM.check_commercial_features
VM.unlock_commercial_features
ManagementAgent.stop
ManagementAgent.start_local
ManagementAgent.start
VM.classloader_stats
GC.rotate_log
Thread.print 打印线程栈信息Thread.print
GC.class_stats
GC.class_histogram 查看系统中类统计信息
GC.heap_dump 导出堆信息GC.heap_dump
GC.finalizer_info
GC.heap_info
GC.run_finalization
GC.run 执行GC操作
VM.uptime 查看虚拟机启动时间VM.uptime
VM.dynlibs
VM.flags 获取启动参数VM.flags
VM.system_properties
VM.command_line
VM.version
help
For more information about a specific command use 'help <command>'.
特别注意,上面并没有PerfCounter.print这条命了,但是也可以使用。作用是:可详细打印对应java进程的有效性能计数器(performance counters)
jobs jcmd 61185 VM.check_commercial_features查看进程的jfr功能是否加锁
最早jfr功能是商用的,现在已经开源,可以直接使用
➜ jobs jcmd 61185 VM.check_commercial_features
61185:
Commercial Features are unlocked.
Status of individual features:
Java Flight Recorder has been used.
Resource Management is disabled.
Current Memory Restriction: None (0)
解锁jfr-Java Flight Recorder功能,默认是加锁的
➜ jobs jcmd 61185 VM.unlock_commercial_features
61185:
Commercial Features already unlocked.
jcmd 61185 JFR.start 开启jfr录制
➜ jobs jcmd 61185 JFR.start
61185:
Started recording 3. No limit (duration/maxsize/maxage) in use.
Use JFR.dump recording=3 filename=FILEPATH to copy recording data to file.
输出录制文件,文件后缀命建议.jfr,这样直接双击*.jfr,就可以使用jmc工具打开进行分析
必须指定上面的参数recording和参数filename
➜ jobs jcmd 61185 JFR.dump filename=./test.jfr recording=3
61185:
Dumped recording 3, 809.8 kB written to:
/Users/xxxx/github/jenkins/test.jfr
jobs jcmd 61185 JFR.stop recording=3 停止录制
➜ jobs jcmd 61185 JFR.stop recording=3
61185:
Stopped recording 3.
某个具体命令的帮助
D:\>jcmd 9816 help GC.run
9816:
GC.run
Call java.lang.System.gc().
Impact: Medium: Depends on Java heap size and content.
Syntax: GC.run
关于jfr的性能消耗
Java Flight Recorder (JFR) is a tool for collecting diagnostic and profiling data about a running Java application. It is integrated into the Java Virtual Machine (JVM) and causes almost no performance overhead, so it can be used even in heavily loaded production environments. When default settings are used, both internal testing and customer feedback indicate that performance impact is less than one percent. For some applications, it can be significantly lower. However, for short-running applications (which are not the kind of applications running in production environments), relative startup and warmup times can be larger, which might impact the performance by more than one percent. JFR collects data about the JVM as well as the Java application running on it.
命令的更多参数
https://www.jianshu.com/p/a6fa4cc2860c
如何利用JMC分析性能
https://blog.csdn.net/h254532699/article/details/54342511/
jcmd的简单实用的更多相关文章
- jQuery的几种简单实用效果
许久未分享博客,或许已生疏. 闲来无事, 分享几个jQuery简单实用的效果案例 不喜勿喷... 1.页面常用的返回顶部 <!DOCTYPE html> <html lang=&qu ...
- 经验分享:10个简单实用的 jQuery 代码片段
尽管各种 JavaScirpt 框架和库层出不穷,jQuery 仍然是 Web 前端开发中最常用的工具库.今天,向大家分享我觉得在网站开发中10个简单实用的 jQuery 代码片段. 您可能感兴趣的相 ...
- 简单实用的PHP防注入类实例
这篇文章主要介绍了简单实用的PHP防注入类实例,以两个简单的防注入类为例介绍了PHP防注入的原理与技巧,对网站安全建设来说非常具有实用价值,需要的朋友可以参考下 本文实例讲述了简单实用的PHP防注 ...
- php简单实用的操作文件工具类(创建、移动、复制、删除)
php简单实用好用的文件及文件夹复制函数和工具类(创建.移动.复制.删除) function recurse_copy($src,$dst) { // 原目录,复制到的目录 $dir = opend ...
- 基于Bootstrap简单实用的tags标签插件
http://www.htmleaf.com/jQuery/ jQuery之家 自由分享jQuery.html5和css3的插件库 基于Bootstrap简单实用的tags标签插件
- C#_简单实用的翻页
简单实用的生成翻页HTML辅助类 C# using System.Text; namespace ClassLibrary { /// <summary> /// /// </sum ...
- 简单实用的Windows命令(一)
前几天新买了一台笔记本电脑,使用了一下几个简单的查看电脑配置的命令,觉得非常的不错,在此记录一下 一:运行命令的方式有两种 1:使用快捷键WIN+R,然后在弹出的“运行”对话框中输入对应的命令 2:在 ...
- 简单实用的Windows命令(二)
昨天简单的记录了几个非常简单实用的Windows命令,不过我又想起来还有两个我在实际的工作中也是经常用到的命令——PING和IPCONFIG,不过我在工作中的使用都是非常简单的,用PING命令检测对应 ...
- iOS边练边学--多线程介绍、NSThread的简单实用、线程安全以及线程之间的通信
一.iOS中的多线程 多线程的原理(之前多线程这块没好好学,之前对多线程的理解也是错误的,这里更正,好好学习这块) iOS中多线程的实现方案有以下几种 二.NSThread线程类的简单实用(直接上代码 ...
随机推荐
- Zatree - Zabbix图表展示
Zatree Zatree 是 一个php web的插件,做个展示树:可以提供host group的树形展示和在item里指定关键字查询及数据排序. 下载地址 可以根据zabbix不同版本下载:htt ...
- 1-STM32物联网开发WIFI+GPRS(Wi-Fi入门篇)_简介
这期的教程为公开教程将用这块开发板学习WIFI(SDK) 实现哪些功能呢!无非就是那写网络功能...但是涉及的挺多 最近一直在忙方案篇的内容,所以公开版的例程耽误了,现在开始补上 我准备改变一下提供资 ...
- 【概率论】5-7:Gama分布(The Gamma Distributions Part II)
title: [概率论]5-7:Gama分布(The Gamma Distributions Part II) categories: - Mathematic - Probability keywo ...
- 9、共享变量(Broadcast Variable和Accumulator)
一.共享变量 1.共享变量工作原理 Spark一个非常重要的特性就是共享变量. 默认情况下,如果在一个算子的函数中使用到了某个外部的变量,那么这个变量的值会被拷贝到每个task中.此时每个task只能 ...
- 部署Django到云服务器(centos+nginx+mysql+uwsgi+python3)【操作篇(2)】
接上篇操作篇(1):https://blog.csdn.net/jacky_zhuyuanlu/article/details/82880612 (七)创建Django项目 (1)建立文件夹,存放网站 ...
- C# 常用日期取得
列举一下常用的日期取得方法 static class DateTimeDemo { public static DateTime FirstDayOfMonth(this DateTime value ...
- archlinux安装nvidia-1050ti闭源驱动教程,亲测
link:https://blog.csdn.net/u014025444/article/details/91454059
- struts的带参数结果集
action在forward过程中共享一个值栈,也就是一次request只有一个值栈,服务器端的forward对于客户端来说就是一次request,在forward过程就没必要再传参数了. 总结也就是 ...
- Java设计模式之二工厂模式
在上一篇中我们学习了单例模式,介绍了单例模式创建的几种方法以及最优的方法.本篇则介绍设计模式中的工厂模式,主要分为简单工厂模式.工厂方法和抽象工厂模式. 简单工厂模式 简单工厂模式是属于创建型模式,又 ...
- 利用Git上传项目到github以及遇到的问题
今天学习如何利用git从本地端上传项目,以及遇到问题的解决方法 1.要有自己的github账号,并创建一个仓库, 2.输入仓库的名称,直接Create 注:记住常见成功后的这个地址,后边要用到: 3. ...