当前位置:网站首页>JVM debugging tool -jmap
JVM debugging tool -jmap
2022-06-24 07:15:00 【Angryshark_ one hundred and twenty-eight】
jmap
jmap Command is a tool that can output all objects in memory , You can even put VM Medium heap, Binary output into text .
Print out something java process ( Use pid) In memory , all ‘ object ’ The situation of ( Such as : Produce those objects , And quantity ).
Command usage :jmap [option]
(to connect to running process) Connect to a running process
jmap [option] <executable <core>
(to connect to a core file) Connect to the core file
jmap [option] [[email protected]]<remote server IP or hostname>
(to connect to remote debug server) Connect to remote debugging service
pid: Target process PID, Process number , May adopt ps -ef | grep java see java Process PID;
executable: produce core dump Of java Executable program ;
core: The message will be printed core dump file ;
remote-hostname-or-IP: long-range debug The hostname or ip;
server-id: only id, Suppose you have multiple remotes on a single host debug service ;
Common commands
Print Java Heap profile , Including the GC Algorithm 、 Heap configuration parameters and heap memory usage in each generation
> jmap -heap 23766
Attaching to process ID 31846, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 24.71-b01
using thread-local object allocation.
Parallel GC with 4 thread(s)//GC The way
Heap Configuration: // Heap memory initialization configuration
MinHeapFreeRatio = 0 // Corresponding jvm Launch parameters -XX:MinHeapFreeRatio Set up JVM Heap minimum idle ratio (default 40)
MaxHeapFreeRatio = 100 // Corresponding jvm Launch parameters -XX:MaxHeapFreeRatio Set up JVM The maximum idle ratio of the heap (default 70)
MaxHeapSize = 2082471936 (1986.0MB) // Corresponding jvm Launch parameters -XX:MaxHeapSize= Set up JVM The maximum size of the heap
NewSize = 1310720 (1.25MB)// Corresponding jvm Launch parameters -XX:NewSize= Set up JVM Heaped ‘ The new generation ’ Default size of
MaxNewSize = 17592186044415 MB// Corresponding jvm Launch parameters -XX:MaxNewSize= Set up JVM Heaped ‘ The new generation ’ Maximum size of
OldSize = 5439488 (5.1875MB)// Corresponding jvm Launch parameters -XX:OldSize=<value>: Set up JVM Heaped ‘ Old generation ’ Size
NewRatio = 2 // Corresponding jvm Launch parameters -XX:NewRatio=:‘ The new generation ’ and ‘ Old generation ’ The size ratio of
SurvivorRatio = 8 // Corresponding jvm Launch parameters -XX:SurvivorRatio= Set up a young generation Eden District and Survivor Area size ratio
PermSize = 21757952 (20.75MB) // Corresponding jvm Launch parameters -XX:PermSize=<value>: Set up JVM Heaped ‘ Eternal generation ’ Initial size of
MaxPermSize = 85983232 (82.0MB)// Corresponding jvm Launch parameters -XX:MaxPermSize=<value>: Set up JVM Heaped ‘ Eternal generation ’ Maximum size of
G1HeapRegionSize = 0 (0.0MB)
Heap Usage:// Heap memory usage
PS Young Generation
Eden Space://Eden Area memory distribution
capacity = 33030144 (31.5MB)//Eden Total area capacity
used = 1524040 (1.4534378051757812MB) //Eden Zone used
free = 31506104 (30.04656219482422MB) //Eden Area remaining capacity
4.614088270399305% used //Eden Area usage ratio
From Space: // One of them Survivor Area memory distribution
capacity = 5242880 (5.0MB)
used = 0 (0.0MB)
free = 5242880 (5.0MB)
0.0% used
To Space: // the other one Survivor Area memory distribution
capacity = 5242880 (5.0MB)
used = 0 (0.0MB)
free = 5242880 (5.0MB)
0.0% used
PS Old Generation // Current Old Area memory distribution
capacity = 86507520 (82.5MB)
used = 0 (0.0MB)
free = 86507520 (82.5MB)
0.0% used
PS Perm Generation// Current “ Eternal generation ” Distribution of memory
capacity = 22020096 (21.0MB)
used = 2496528 (2.3808746337890625MB)
free = 19523568 (18.619125366210938MB)
11.337498256138392% used
670 interned Strings occupying 43720 bytes.
Print Java Histogram of objects in heap , Each... Can be obtained from this diagram class The number of objects , Occupied memory size and class full name information , close :live, Only the living objects are counted
> jmap -histo 23766
23766: Unable to open socket file: target process not responding or HotSpot VM not loaded
The -F option can be used when the target process is not responding
> jmap -F -histo 23766
Attaching to process ID 23766, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.191-b12
Iterating over heap. This may take a while...
num #instances #bytes class name
----------------------------------------------
1: 245237 26378800 [C
2: 18355 19262448 [B
3: 45062 14682856 [I
4: 245389 5889336 java.util.HashMap$Node
5: 274529 4392464 java.lang.String
6: 44989 4087960 [Ljava.util.HashMap$Node;
7: 68684 3150440 [Ljava.lang.Object;
8: 18342 1841288 java.lang.Class
9: 28573 1828672 java.lang.reflect.Field
10: 42818 1712720 java.util.HashMap
11: 30488 1556088 [Ljava.lang.String;
12: 32420 1037440 java.util.LinkedHashMap$Entry

Print object information waiting to be recycled
> jmap -finalizerinfo 23766
Attaching to process ID 23766, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.191-b12
Number of objects pending for finalization: 0
# Show the current F-QUEUE There is no waiting in the queue Fializer Threads execute finalizer Object of method .
With hprof Binary format will Java The heap information is output to a file , This document can be used MAT、VisualVM or jhat Wait for tools to check
# output to a file , Note that the application will be suspended
> jmap -dump:live,format=b,file=heapDump 23766
Dumping heap to /home/oidd/heapDump ...
Heap dump file created
# Access... Through a browser
> jhat -port 5000 heapDump
Reading from heapDump...
Dump file created Thu Sep 17 08:43:21 CST 2020
Snapshot read, resolving...
Resolving 314429 objects...
Chasing references, expect 62 dots..............................................................
Eliminating duplicate references..............................................................
Snapshot resolved.
Started HTTP server on port 5000
Server is ready.
visit :http://localhost:5000/

边栏推荐
- Huawei cloud image engine service
- 成为 TD Hero,做用技术改变世界的超级英雄 | 来自 TDengine 社区的邀请函
- 【愚公系列】2022年6月 ASP.NET Core下CellReport报表工具基本介绍和使用
- 如何删除/选择电脑上的输入法
- In the middle of the year, I have prepared a small number of automated interview questions. Welcome to the self-test
- 2022蓝队HW初级面试题总结
- Mysql开启BINLOG
- Huawei cloud database advanced learning
- On update current in MySQL_ TIMESTAMP
- 【图像融合】基于伪 Wigner 分布 (PWD) 实现图像融合附matlab代码
猜你喜欢

MAUI使用Masa blazor组件库

Intelligent Vision Group A4 paper recognition example

取模软件 模拟显示验证取模数据正确性 逆向 把点阵数组bin文件转显示

在终端pip install xxx但在pycharm却no module named xxx

Unexpected token u in JSON at position 0

开源与创新

Become TD hero, a superhero who changes the world with Technology | invitation from tdengine community

setInterval里面的函数不能有括号

【小技巧】使用matlab的深度学习工具箱deepNetworkDesigner快速设计

【图像融合】基于像素显着性结合小波变换实现多焦点和多光谱图像融合附matlab代码
随机推荐
Bay area enterprises quick look! The focus of the data regulations of Shenzhen Special Economic Zone just released is coming!
【信号识别】基于深度学习CNN实现信号调制分类附matlab代码
大厂不是衡量能力的唯一出路,上财学姐毕业三年的经验分享
Another double win! Tencent's three security achievements were selected into the 2021 wechat independent innovation achievements recommendation manual
Spark项目打包优化实践
Le système de surveillance du nuage hertzbeat v1.1.0 a été publié, une commande pour démarrer le voyage de surveillance!
Spark累加器和廣播變量
C: use of mutex
You have a chance, here is a stage
Vmware tools still exist after normal uninstallation for many times. How to solve it
潞晨科技获邀加入NVIDIA初创加速计划
[problem solving] the connection to the server localhost:8080 was referred
Typora收费?搭建VS Code MarkDown写作环境
Win11分磁盘怎么分?Win11系统怎么分磁盘?
JVM调试工具-jstack
JVM debugging tool -jvisualvm
【问题解决】虚拟机配置静态ip
【pointNet】基于pointNet的三维点云目标分类识别matlab仿真
Arduino融资3200万美元,进军企业市场
How to send SMS in groups? What are the reasons for the poor effect of SMS in groups?