当前位置:网站首页>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操作
生成堆转储文件
显示虚拟机配置的参数
边栏推荐
- 三级菜单数据实现,实现嵌套三级菜单数据
- 搞懂fastjson 对泛型的反序列化原理
- Mac version PHP installed Xdebug environment (M1 version)
- Red Hat安装内核头文件
- Web authentication API compatible version information
- Financial risk control practice - decision tree rule mining template
- PTA TIANTI game exercise set l2-003 moon cake test point 2, test point 3 Analysis
- [SQL practice] a SQL statistics of epidemic distribution across the country
- SQLSTATE[HY000][1130] Host ‘host. docker. internal‘ is not allowed to connect to this MySQL server
- Go语学习笔记 - gorm使用 - gorm处理错误 | Web框架Gin(十)
猜你喜欢
判断文件是否为DICOM文件
Understand the deserialization principle of fastjson for generics
Add salt and pepper noise or Gaussian noise to the picture
yarn入门(一篇就够了)
If you don't know these four caching modes, dare you say you understand caching?
JVM命令之 jstack:打印JVM中线程快照
Hcip eighth operation
深度聚类:将深度表示学习和聚类联合优化
驱动开发中platform设备驱动架构详解
Say sqlyog deceived me!
随机推荐
Financial risk control practice - decision tree rule mining template
What is message queuing?
Hcip seventh operation
Convert numbers to string strings (to_string()) convert strings to int sharp tools stoi();
Determine whether the file is a DICOM file
绕过open_basedir
PTA TIANTI game exercise set l2-003 moon cake test point 2, test point 3 Analysis
Add salt and pepper noise or Gaussian noise to the picture
Flask 1.1.4 werkzeug1.0.1 analyse du code source: processus de démarrage
Introduction to yarn (one article is enough)
STM32 key state machine 2 - state simplification and long press function addition
PowerPivot——DAX(函数)
解决pod install报错:ffi is an incompatible architecture
An example of multi module collaboration based on NCF
产业金融3.0:“疏通血管”的金融科技
I didn't know it until I graduated -- the principle of HowNet duplication check and examples of weight reduction
What is make makefile cmake qmake and what is the difference?
Flask1.1.4 Werkzeug1.0.1 源碼分析:啟動流程
yarn入门(一篇就够了)
Reptile exercises (III)