当前位置:网站首页>jvm命令之 jcmd:多功能命令行
jvm命令之 jcmd:多功能命令行
2022-07-07 00:46:00 【张俊杰1994】
学习 尚硅谷 宋红康 JVM从入门到精通 的学习笔记
概述
在jdk1.7以后,新增了这个命令行工具,jcmd,这个工具就像一个瑞士军刀一样,集成了jstat之外所有命令的功能,比如说用jcmd命令来导出堆、内存使用、查看Java进程、导出线程信息、执行GC、JVM运行时间等等。
jcmd有jmap的大部分功能,并且在Oracle的官方网上上也推荐使用jcmd命名代替jmap命令。
基本的语法
jcmd -l
列出所有的JVM进程

上面的操作就和jsp很像了
jcmd 进程号 help
针对指定的进程,有哪些命令可以使用的

jcmd 进程号 具体命令
显示指定进程的指令命令的数据
根据以上命令来替换之前的那些操作:
Thread.print 可以替换 jstack指令
GC.class_histogram 可以替换 jmap中的-histo操作
GC.heap_dump 可以替换 jmap中的-dump操作
GC.run 可以查看GC的执行情况
VM.uptime 可以查看程序的总执行时间,可以替换jstat指令中的-t操作
VM.system_properties 可以替换 jinfo -sysprops 进程id
VM.flags 可以获取JVM的配置参数信息
打印线程信息
通过 Thread.print 可以替换 jstack指令 查看程序是否有死锁
GC.heap_dump 可以替换 jmap中的-dump操作
生成堆转储文件

显示虚拟机配置的参数
边栏推荐
- 老板总问我进展,是不信任我吗?(你觉得呢)
- [daily training -- Tencent selected 50] 235 Nearest common ancestor of binary search tree
- Flask1.1.4 Werkzeug1.0.1 源碼分析:啟動流程
- Bbox regression loss function in target detection -l2, smooth L1, IOU, giou, Diou, ciou, focal eiou, alpha IOU, Siou
- Cf:c. column swapping [sort + simulate]
- CTFshow--常用姿势
- Red hat install kernel header file
- 目标检测中的损失函数与正负样本分配:RetinaNet与Focal loss
- win配置pm2开机自启node项目
- 三级菜单数据实现,实现嵌套三级菜单数据
猜你喜欢

An example of multi module collaboration based on NCF

三级菜单数据实现,实现嵌套三级菜单数据

What is message queuing?

JVM the truth you need to know

mac版php装xdebug环境(m1版)

10W word segmentation searches per second, the product manager raised another demand!!! (Collection)

EMMC print cqhci: timeout for tag 10 prompt analysis and solution

PTA 天梯赛练习题集 L2-004 搜索树判断

关于STC单片机“假死”状态的判别

Message queue: how to deal with message backlog?
随机推荐
毕业之后才知道的——知网查重原理以及降重举例
Message queue: how to deal with message backlog?
Mysql-centos7 install MySQL through yum
TCC of distributed transaction solutions
Cf:c. column swapping [sort + simulate]
Say sqlyog deceived me!
盘点国内有哪些EDA公司?
PTA 天梯赛练习题集 L2-003 月饼 测试点2,测试点3分析
CMD permanently delete specified folders and files
What EDA companies are there in China?
目标检测中的BBox 回归损失函数-L2,smooth L1,IoU,GIoU,DIoU,CIoU,Focal-EIoU,Alpha-IoU,SIoU
Bbox regression loss function in target detection -l2, smooth L1, IOU, giou, Diou, ciou, focal eiou, alpha IOU, Siou
Red hat install kernel header file
每秒10W次分词搜索,产品经理又提了一个需求!!!(收藏)
搞懂fastjson 对泛型的反序列化原理
STM32 key state machine 2 - state simplification and long press function addition
nVisual网络可视化
上海字节面试问题及薪资福利
Nodejs get client IP
【FPGA教程案例13】基于vivado核的CIC滤波器设计与实现