当前位置:网站首页>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/

边栏推荐
- 原神方石机关解密
- Outils de débogage JVM - Arthas
- Decryption of the original divine square stone mechanism
- Smart space 𞓜 visualization of operation of digital twin cargo spacecraft
- 超宽带脉冲定位方案,UWB精准定位技术,无线室内定位应用
- I failed to delete the database and run away
- How do I check the IP address? What is an IP address
- 【图像融合】基于像素显着性结合小波变换实现多焦点和多光谱图像融合附matlab代码
- The third session of freshman engineering education seminar is under registration
- FreeRTOS MPU使系统更健壮!
猜你喜欢

机器人迷雾之算力与智能

In the middle of the year, I have prepared a small number of automated interview questions. Welcome to the self-test

LuChen technology was invited to join NVIDIA startup acceleration program

FreeRTOS MPU使系统更健壮!

Leetcode probability interview shock series 11~15

【信号识别】基于深度学习CNN实现信号调制分类附matlab代码

Decryption of the original divine square stone mechanism

内网学习笔记(4)

大厂不是衡量能力的唯一出路,上财学姐毕业三年的经验分享

关于取模数据序号定位的说明 区码定位是指GBK编码
随机推荐
Canal安装配置
Smart space 𞓜 visualization of operation of digital twin cargo spacecraft
Unexpected token u in JSON at position 0
How to send SMS in groups? What are the reasons for the poor effect of SMS in groups?
【WordPress建站】6. 文章内容防复制
Development of IOT device end - establishment of development environment
華為雲數據庫進階學習
捏脸师: 炙手可热的元宇宙造型师
【愚公系列】2022年6月 ASP.NET Core下CellReport报表工具基本介绍和使用
Spark project Packaging Optimization Practice
EasyDSS_ The dash version solves the problem that the RTSP source address cannot play the video stream
为什么要用lock 【readonly】object?为什么不要lock(this)?
年中了,准备了少量的自动化面试题,欢迎来自测
数据同步工具 DataX 已经正式支持读写 TDengine
JVM调试工具-jvisualvm
App management platform app host
Tencent host security captures Yapi remote code execution 0day vulnerability for wild exploitation. The attack is spreading and can be intercepted by firewall
I failed to delete the database and run away
JVM調試工具-Arthas
智能视觉组A4纸识别样例