基础 | JVM - [指令 & 性能监控]

INDEX

        • [jps(jvm 进程工具)](#jps(jvm 进程工具))
        • [jinfo(java 配置信息工具)](#jinfo(java 配置信息工具))
        • [jstack (查看虚拟机栈信息)](#jstack (查看虚拟机栈信息))
        • [jmap(jvm 内存影像工具)](#jmap(jvm 内存影像工具))
        • [jstat(jvm 统计信息监控工具)](#jstat(jvm 统计信息监控工具))
        • [jvisualvm(查看 java 堆信息)](#jvisualvm(查看 java 堆信息))
        • [jconsole(查看 java 堆信息)](#jconsole(查看 java 堆信息))

JDK 的指令是指类似下面的指令

jps(jvm 进程工具)

jps -l

如下图,红框即进程号

jinfo(java 配置信息工具)

jinfo 进程号

参数说明

  • -flag
    查询指定 boolean 型 XX 参数,如
    jinfo -flag PrintGCDetails 19496

    全部信息如下
shell 复制代码
Attaching to process ID 19496, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.333-b02
Java System Properties:

java.runtime.name = Java(TM) SE Runtime Environment
java.vm.version = 25.333-b02
sun.boot.library.path = C:\Program Files\Java\jdk1.8.0_333\jre\bin
java.vendor.url = http://java.oracle.com/
java.vm.vendor = Oracle Corporation
path.separator = ;
file.encoding.pkg = sun.io
java.vm.name = Java HotSpot(TM) 64-Bit Server VM
sun.os.patch.level =
sun.java.launcher = SUN_STANDARD
user.script =
user.country = CN
user.dir = D:\_gitworkspace\base-learning
java.vm.specification.name = Java Virtual Machine Specification
java.runtime.version = 1.8.0_333-b02
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
os.arch = amd64
java.endorsed.dirs = C:\Program Files\Java\jdk1.8.0_333\jre\lib\endorsed
line.separator =

java.io.tmpdir = C:\Users\GILGAM~1\AppData\Local\Temp\
java.vm.specification.vendor = Oracle Corporation
user.variant =
os.name = Windows 11
sun.jnu.encoding = GBK
java.library.path = C:\Program Files\Java\jdk1.8.0_333\bin;C:\Windows\Sun\Java\bin;C:\Wind
ows\system32;C:\Windows;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Window
s\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Pr
ogram Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Program Files\To
rtoiseGit\bin;D:\Program Files (x86)\NetSarang\Xshell 7\;D:\Program Files (x86)\NetSarang\
Xftp 7\;C:\Users\Gilgamesh\AppData\Local\Microsoft\WindowsApps;D:\IntelliJ IDEA 2021.3.2\bin;;C:\Program Files\Java\jdk1.8.0_333\bin;C:\Program Files\Java\jdk1.8.0_333\jre\bin;;.  
java.specification.name = Java Platform API Specification
java.class.version = 52.0
sun.management.compiler = HotSpot 64-Bit Tiered Compilers
os.version = 10.0
user.home = C:\Users\Gilgamesh
user.timezone = GMT+08:00
java.awt.printerjob = sun.awt.windows.WPrinterJob
file.encoding = UTF-8
java.specification.version = 1.8
user.name = Gilgamesh
java.class.path = C:\Program Files\Java\jdk1.8.0_333\jre\lib\charsets.jar;C:\Program Files
\Java\jdk1.8.0_333\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\ext\acces
s-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\ext\cldrdata.jar;C:\Program Fil
es\Java\jdk1.8.0_333\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\ext\
jaccess.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\ext\jfxrt.jar;C:\Program Files\Java
\jdk1.8.0_333\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\ext\na
shorn.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\ext\sunec.jar;C:\Program Files\Java\j
dk1.8.0_333\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\ext
\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\ext\sunpkcs11.jar;C:\Program Fil
es\Java\jdk1.8.0_333\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\java
ws.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_3
33\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\jfxswt.jar;C:\Program Files\
Java\jdk1.8.0_333\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\management-a
gent.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.
8.0_333\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\rt.jar;D:\_gitwor
kspace\base-learning\target\classes;D:\_mavenRepository\org\springframework\boot\spring-bo
ot-starter\2.7.3\spring-boot-starter-2.7.3.jar;D:\_mavenRepository\org\springframework\boo
t\spring-boot\2.7.3\spring-boot-2.7.3.jar;D:\_mavenRepository\org\springframework\spring-c
ontext\5.3.22\spring-context-5.3.22.jar;D:\_mavenRepository\org\springframework\spring-aop
\5.3.22\spring-aop-5.3.22.jar;D:\_mavenRepository\org\springframework\spring-beans\5.3.22\
spring-beans-5.3.22.jar;D:\_mavenRepository\org\springframework\spring-expression\5.3.22\s
pring-expression-5.3.22.jar;D:\_mavenRepository\org\springframework\boot\spring-boot-autoc
onfigure\2.7.3\spring-boot-autoconfigure-2.7.3.jar;D:\_mavenRepository\org\springframework
\boot\spring-boot-starter-logging\2.7.3\spring-boot-starter-logging-2.7.3.jar;D:\_mavenRep
ository\ch\qos\logback\logback-classic\1.2.11\logback-classic-1.2.11.jar;D:\_mavenReposito
ry\ch\qos\logback\logback-core\1.2.11\logback-core-1.2.11.jar;D:\_mavenRepository\org\apac
he\logging\log4j\log4j-to-slf4j\2.17.2\log4j-to-slf4j-2.17.2.jar;D:\_mavenRepository\org\a
pache\logging\log4j\log4j-api\2.17.2\log4j-api-2.17.2.jar;D:\_mavenRepository\org\slf4j\ju
l-to-slf4j\1.7.36\jul-to-slf4j-1.7.36.jar;D:\_mavenRepository\jakarta\annotation\jakarta.a
nnotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;D:\_mavenRepository\org\springframewo
rk\spring-core\5.3.22\spring-core-5.3.22.jar;D:\_mavenRepository\org\springframework\sprin
g-jcl\5.3.22\spring-jcl-5.3.22.jar;D:\_mavenRepository\org\yaml\snakeyaml\1.30\snakeyaml-1
.30.jar;D:\_mavenRepository\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;D:\IntelliJ IDEA 2021.3.2\lib\idea_rt.jar
java.vm.specification.version = 1.8
sun.arch.data.model = 64
sun.java.command = base.learning.JVMParamsDeme
java.home = C:\Program Files\Java\jdk1.8.0_333\jre
user.language = zh
java.specification.vendor = Oracle Corporation
awt.toolkit = sun.awt.windows.WToolkit
java.vm.info = mixed mode
java.version = 1.8.0_333
java.ext.dirs = C:\Program Files\Java\jdk1.8.0_333\jre\lib\ext;C:\Windows\Sun\Java\lib\ext
sun.boot.class.path = C:\Program Files\Java\jdk1.8.0_333\jre\lib\resources.jar;C:\Program 
Files\Java\jdk1.8.0_333\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\sunrsasi
gn.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_
333\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_333\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_333\jre\classes       
java.vendor = Oracle Corporation
file.separator = \
java.vendor.url.bug = http://bugreport.sun.com/bugreport/
sun.io.unicode.encoding = UnicodeLittle
sun.cpu.endian = little
sun.desktop = windows
sun.cpu.isalist = amd64

VM Flags:
Non-default VM flags: -XX:CICompilerCount=12 -XX:InitialHeapSize=264241152 -XX:MaxHeapSize
=4219469824 -XX:MaxNewSize=1406140416 -XX:MinHeapDeltaBytes=524288 -XX:NewSize=88080384 -X
X:OldSize=176160768 -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseFastUnorderedTimeStamps -XX:-UseLargePagesIndividualAllocation -XX:+UseParallelGC
Command line:  -javaagent:D:\IntelliJ IDEA 2021.3.2\lib\idea_rt.jar=51254:D:\IntelliJ IDEA 2021.3.2\bin -Dfile.encoding=UTF-8
jstack (查看虚拟机栈信息)

常使用此指令排查死锁
jstack 进程号

查看进程的栈信息 jstack 7976

jmap(jvm 内存影像工具)
jstat(jvm 统计信息监控工具)
jvisualvm(查看 java 堆信息)
jconsole(查看 java 堆信息)
相关推荐
java1234_小锋1 小时前
JVM对象分配内存如何保证线程安全?
jvm
40岁的系统架构师5 小时前
1 JVM JDK JRE之间的区别以及使用字节码的好处
java·jvm·python
寻找沙漠的人5 小时前
理解JVM
java·jvm·java-ee
我叫啥都行5 小时前
计算机基础复习12.22
java·jvm·redis·后端·mysql
bufanjun0018 小时前
JUC并发工具---ThreadLocal
java·jvm·面试·并发·并发基础
东阳马生架构20 小时前
JVM简介—1.Java内存区域
jvm
工程师老罗20 小时前
Android笔试面试题AI答之SQLite(2)
android·jvm·sqlite
Qzer_4071 天前
jvm字节码中方法的结构
jvm
奇偶变不变1 天前
RTOS之事件集
java·linux·jvm·单片机·算法
Qzer_4071 天前
JVM中的方法绑定机制
java·开发语言·jvm