标签:list 格式 success apr 自己 asp compress bug finalize
概述
背景
之前聊过一些简单的命令行工具
如果我想查看堆内存里到底有什么, 有办法吗?
作为一个学渣, 之前这些东西, 我都得过且过, 或者压根不管他们存在不存在
环境
示例进程
jps
约定
概述
jmap
命令
>jmap 8944
Attaching to process ID 8944, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.181-b13
0x000000005f8a0000 52K C:\Program Files\Java\jdk1.8.0_181\jre\bin\management.dll
0x000000005f8b0000 68K C:\Program Files\Java\jdk1.8.0_181\jre\bin\nio.dll
0x000000005f8d0000 104K C:\Program Files\Java\jdk1.8.0_181\jre\bin\net.dll
0x000000005f8f0000 140K C:\Program Files\Java\jdk1.8.0_181\jre\bin\instrument.dll
0x000000005f920000 88K C:\Program Files\Java\jdk1.8.0_181\jre\bin\zip.dll
0x000000005f940000 164K C:\Program Files\Java\jdk1.8.0_181\jre\bin\java.dll
0x000000005f970000 60K C:\Program Files\Java\jdk1.8.0_181\jre\bin\verify.dll
0x000000005f980000 8840K C:\Program Files\Java\jdk1.8.0_181\jre\bin\server\jvm.dll
0x0000000060230000 840K C:\Program Files\Java\jdk1.8.0_181\jre\bin\msvcr100.dll
...
内容
共享对象
疑问1
又是一些疑问
共享对象
引入时间
目的
机制
其他
命令
>jmap -heap 8944
Attaching to process ID 8944, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.181-b13
using thread-local object allocation.
Parallel GC with 10 thread(s)
Heap Configuration:
MinHeapFreeRatio = 0
MaxHeapFreeRatio = 100
MaxHeapSize = 17163091968 (16368.0MB)
NewSize = 357564416 (341.0MB)
MaxNewSize = 5721030656 (5456.0MB)
OldSize = 716177408 (683.0MB)
NewRatio = 2
SurvivorRatio = 8
MetaspaceSize = 21807104 (20.796875MB)
CompressedClassSpaceSize = 1073741824 (1024.0MB)
MaxMetaspaceSize = 17592186044415 MB
G1HeapRegionSize = 0 (0.0MB)
Heap Usage:
PS Young Generation
Eden Space:
capacity = 268435456 (256.0MB)
used = 26775152 (25.534774780273438MB)
free = 241660304 (230.46522521972656MB)
9.974521398544312% used
From Space:
capacity = 44564480 (42.5MB)
used = 20312032 (19.371063232421875MB)
free = 24252448 (23.128936767578125MB)
45.578972311580884% used
To Space:
capacity = 44564480 (42.5MB)
used = 0 (0.0MB)
free = 44564480 (42.5MB)
0.0% used
PS Old Generation
capacity = 468189184 (446.5MB)
used = 15216480 (14.511566162109375MB)
free = 452972704 (431.9884338378906MB)
3.2500708089830628% used
16826 interned Strings occupying 2198488 bytes.
解释
Parallel GC with 10 thread(s)
Heap Configuration
Heap Usage
16826 interned Strings occupying 2198488 bytes.
疑问
命令
>jmap -finalizerinfo 8944
Attaching to process ID 8944, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.181-b13
Number of objects pending for finalization: 0
解释
命令
>jmap -histo 8944
num #instances #bytes class name
----------------------------------------------
1: 370446 47173928 [C
2: 13190 16507488 [B
3: 237789 5706936 java.lang.String
4: 3867 3913304 [I
5: 56074 2945096 [Ljava.lang.String;
6: 42757 1368224 java.io.File
7: 32465 1298600 java.util.LinkedHashMap$Entry
...
...
解释
排列顺序
1: 370446 47173928 [C
[C
[C
继续解释
疑问
[C
命令
# 1. 这次就带上 live 了
# 2. 写作中途电脑又重启了, 所以 pid 换了
>jmap -dump:live,format=b,file=dump.txt 14504
Dumping heap to E:\dump.txt ...
Heap dump file created
解释
结果
ref
后续
标签:list 格式 success apr 自己 asp compress bug finalize
原文地址:https://www.cnblogs.com/xy14/p/12662551.html