当前位置:网站首页>JVM common instructions
JVM common instructions
2022-06-27 06:04:00 【The season when the monsoon dies】
Jmap
Query heap information :jmap -heap pid
C:\Users\41732>jmap -heap 9780
Attaching to process ID 9780, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.152-b16
using thread-local object allocation.
Parallel GC with 4 thread(s)
Heap Configuration:
MinHeapFreeRatio = 0
MaxHeapFreeRatio = 100
MaxHeapSize = 4267704320 (4070.0M
NewSize = 89128960 (85.0MB)
MaxNewSize = 1422393344 (1356.5M
OldSize = 179306496 (171.0MB)
NewRatio = 2
SurvivorRatio = 8
MetaspaceSize = 21807104 (20.796875
CompressedClassSpaceSize = 1073741824 (1024.0M
MaxMetaspaceSize = 17592186044415 MB
G1HeapRegionSize = 0 (0.0MB)
Heap Usage:
PS Young Generation
Eden Space:
capacity = 65536000 (62.5MB)
used = 36124952 (34.451438903808594MB)
free = 29411048 (28.048561096191406MB)
55.12230224609375% used
From Space:
capacity = 14680064 (14.0MB)
used = 4598376 (4.385353088378906MB)
free = 10081688 (9.614646911621094MB)
31.323950631277903% used
To Space:
capacity = 14680064 (14.0MB)
used = 0 (0.0MB)
free = 14680064 (14.0MB)
0.0% used
PS Old Generation
capacity = 110100480 (105.0MB)
used = 13078136 (12.472282409667969MB)
free = 97022344 (92.52771759033203MB)
11.87836419968378% used
15044 interned Strings occupying 2001648 bytes.
View the current number of instances :jmap -histo pid
num #instances #bytes class name
----------------------------------------------
1: 123030 17393624 [C
2: 42214 13424608 [B
3: 10861 4126040 [I
4: 23535 2071080 java.lang.reflect.Method
5: 70927 1702248 java.lang.String
6: 22263 1075592 [Ljava.lang.Object;
7: 37505 779912 [Ljava.lang.Class;
8: 7161 629160 [Ljava.util.HashMap$Node;
9: 12558 602784 java.util.HashMap
10: 5286 592496 java.lang.Class
11: 16836 538752 java.util.HashMap$Node
12: 9808 470784 org.springframework.core.ResolvableType
13: 12865 411680 java.util.ArrayList$Itr
14: 11799 377568 java.util.concurrent.ConcurrentHashMap$Node
15: 9108 364320 java.util.LinkedHashMap$Entry
16: 7767 310680 java.util.HashMap$KeyIterator
17: 11649 279576 java.lang.StringBuilder
18: 3441 271808 [S
19: 4577 256312 java.util.LinkedHashMap
20: 7391 236512 java.lang.ref.WeakReference
21: 3863 223792 [Ljava.lang.reflect.Method;
22: 2952 212544 java.lang.reflect.Field
23: 5122 195728 [Ljava.lang.String;
24: 7907 189768 java.util.ArrayList
25: 1868 189736 [Z
26: 7011 168264 java.util.Collections$UnmodifiableCollection$1
27: 144 156784 [Ljava.util.concurrent.ConcurrentHashMap$Node;
28: 3869 154760 java.lang.ref.SoftReference
- num: Serial number
- instances: Number of instances
- bytes: Occupied space size
- class name: Class name ,[C is a char[],[S is a short[],[I is a int[],[B is a byte[],[[I is a int[][]
Export memory image :jmap ‐dump:format=b,file=fileName pid
C:\Users\41732>jmap -dump:format=b,file=eureka.hprof 9780
Dumping heap to C:\Users\41732\eureka.hprof ...
Heap dump file created
C:\Users\41732>
Jinfo
see jvm Parameters
C:\Users\41732>jinfo -flags 9780
Attaching to process ID 9780, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.152-b16
Non-default VM flags: -XX:-BytecodeVerificationLocal -XX:-BytecodeVerificationRemote -XX:CICompilerCount=3 -XX:InitialHeapSize=268435456 -XX:MaxHeapSize=4267704320 -XX:MaxNewSize=1422393344 -XX:MinHeapDeltaBytes=524288 -XX:NewSize=891289
60 -XX:OldSize=179306496 -XX:TieredStopAtLevel=1 -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseFastUnorderedTimeStamps -XX:-UseLargePagesIndividualAllocation -XX:+UseParallelGC
Command line: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:50964,suspend=y,server=n -XX:TieredStopAtLevel=1 -Xverify:none -Dspring.output.ansi.enabled=always -javaagent:C:\Users\41732\AppData\Local\JetBrains\IntelliJIdea2020.3\c
aptureAgent\debugger-agent.jar -Dfile.encoding=UTF-8
C:\Users\41732>
Jstack
analysis cpu The reason for that
1. find cpu High thread
top -p pid -H # -H It means that it will be printed only once
2. Export the stack information of the thread
C:\Users\41732>jstack 9780 > aa.text
3. Analyze the execution status of the thread in the exported stack information
Be careful :top -p The output thread number is 10 Base number , and jstack The thread number of the exported file is 16 Base number , Need to transform .
jstack 19332 | grep -10 4b8f
"http-nio-8080-ClientPoller-0" #20 daemon prio=5 os_prio=0 tid=0x000000001f6a8000 nid=0x1fb8 runnable [0x0000000020cee000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:296)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(WindowsSelectorImpl.java:278)
at sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:159)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked <0x000000076d2a11e0> (a sun.nio.ch.Util$3)
- locked <0x000000076d2a11d0> (a java.util.Collections$UnmodifiableSet)
- locked <0x000000076d2a1080> (a sun.nio.ch.WindowsSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:1052)
at java.lang.Thread.run(Thread.java:748)
"NioBlockingSelector.BlockPoller-1" #19 daemon prio=5 os_prio=0 tid=0x000000001f680000 nid=0x3c8 runnable [0x0000000020bef000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:296)
at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(WindowsSelectorImpl.java:278)
at sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:159)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked <0x000000076d061bc8> (a sun.nio.ch.Util$3)
- locked <0x000000076d060b20> (a java.util.Collections$UnmodifiableSet)
- locked <0x000000076d05cdd0> (a sun.nio.ch.WindowsSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at org.apache.tomcat.util.net.NioBlockingSelector$BlockPoller.run(NioBlockingSelector.java:342)
Cpu Reasons for soaring
- thread deadlock
- There is an dead loop inside the thread
- The program reproduces high-frequency calculations
- IO Reading and writing too high
- It happens all the time GC
- There are too many threads running concurrently
Jstat
Print GC Information
C:\Users\41732>jstat -gc 9780 1000 10
S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT
14336.0 14336.0 4490.6 0.0 64000.0 35918.3 107520.0 12771.6 24448.0 23677.6 3200.0 2998.1 6 0.039 1 0.033 0.073
14336.0 14336.0 4490.6 0.0 64000.0 35918.3 107520.0 12771.6 24448.0 23677.6 3200.0 2998.1 6 0.039 1 0.033 0.073
14336.0 14336.0 4490.6 0.0 64000.0 35918.3 107520.0 12771.6 24448.0 23677.6 3200.0 2998.1 6 0.039 1 0.033 0.073
14336.0 14336.0 4490.6 0.0 64000.0 35918.3 107520.0 12771.6 24448.0 23677.6 3200.0 2998.1 6 0.039 1 0.033 0.073
14336.0 14336.0 4490.6 0.0 64000.0 35918.3 107520.0 12771.6 24448.0 23677.6 3200.0 2998.1 6 0.039 1 0.033 0.073
14336.0 14336.0 4490.6 0.0 64000.0 35918.3 107520.0 12771.6 24448.0 23677.6 3200.0 2998.1 6 0.039 1 0.033 0.073
14336.0 14336.0 4490.6 0.0 64000.0 35918.3 107520.0 12771.6 24448.0 23677.6 3200.0 2998.1 6 0.039 1 0.033 0.073
14336.0 14336.0 4490.6 0.0 64000.0 35918.3 107520.0 12771.6 24448.0 23677.6 3200.0 2998.1 6 0.039 1 0.033 0.073
14336.0 14336.0 4490.6 0.0 64000.0 35918.3 107520.0 12771.6 24448.0 23677.6 3200.0 2998.1 6 0.039 1 0.033 0.073
14336.0 14336.0 4490.6 0.0 64000.0 35918.3 107520.0 12771.6 24448.0 23677.6 3200.0 2998.1 6 0.039 1 0.033 0.073
C:\Users\41732>
边栏推荐
猜你喜欢
汇编语言-王爽 第11章 标志寄存器-笔记
426 binary tree (513. find the value in the lower left corner of the tree, 112. sum of paths, 106. construct a binary tree from the middle order and post order traversal sequence, 654. maximum binary
Multithreading basic part part 1
Two position relay rxmvb2 r251 204 110dc
LeetCode 0086.分隔链表
Program ape learning Tiktok short video production
使用 WordPress快速个人建站指南
openresty使用文档
Using domain name forwarding mqtt protocol, pit avoidance Guide
Leetcode298 weekly race record
随机推荐
【Cocos Creator 3.5.1】this. node. Use of getposition (this.\u curpos)
yaml文件加密
【入门】正则表达式基础入门笔记
DAST black box vulnerability scanner part 6: operation (final)
项目-h5列表跳转详情,实现后退不刷新,修改数据则刷新的功能(记录滚动条)
leetcode298周赛记录
【Cocos Creator 3.5.1】input. Use of on
NLP-D62-nlp比赛D31&刷题D15
Jump details of item -h5 list, and realize the function of not refreshing when backing up, and refreshing when modifying data (record scroll bar)
426-二叉树(513.找树左下角的值、112. 路径总和、106.从中序与后序遍历序列构造二叉树、654. 最大二叉树)
多线程基础部分Part 1
Junda technology - centralized monitoring scheme for multi brand precision air conditioners
数据库-索引
Multithreading basic Part3
创建一个基础WDM驱动,并使用MFC调用驱动
树莓派4B上运行opcua协议DEMO接入kubeedge
JVM的垃圾回收机制
使用CSDN 开发云搭建导航网站
【Cocos Creator 3.5.1】input.on的使用
JVM调优思路