jmap
此命令用来查看内存信息,实例个数以及占用内存大小
jmap
jmap -histo -F 27515 > ./log.txt
查看堆信息
jmap -heap 进程Id
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | Attaching to process ID 27515, please wait... Debugger attached successfully. Server compiler detected. JVM version is 25.201-b09 using parallel threads in the new generation. using thread-local object allocation. Concurrent Mark-Sweep GC Heap Configuration: MinHeapFreeRatio = 40 MaxHeapFreeRatio = 70 MaxHeapSize = 536870912 (512.0MB) NewSize = 178913280 (170.625MB) MaxNewSize = 178913280 (170.625MB) OldSize = 89522176 (85.375MB) NewRatio = 2 SurvivorRatio = 2 MetaspaceSize = 21807104 (20.796875MB) CompressedClassSpaceSize = 1073741824 (1024.0MB) MaxMetaspaceSize = 17592186044415 MB G1HeapRegionSize = 0 (0.0MB) Heap Usage: New Generation (Eden + 1 Survivor Space): capacity = 134217728 (128.0MB) used = 17779880 (16.956214904785156MB) free = 116437848 (111.04378509521484MB) 13.247042894363403% used Eden Space: capacity = 89522176 (85.375MB) used = 9343864 (8.911003112792969MB) free = 80178312 (76.46399688720703MB) 10.437485344413433% used From Space: capacity = 44695552 (42.625MB) used = 8436016 (8.045211791992188MB) free = 36259536 (34.57978820800781MB) 18.874397165964076% used To Space: capacity = 44695552 (42.625MB) used = 0 (0.0MB) free = 44695552 (42.625MB) 0.0% used concurrent mark-sweep generation: capacity = 201170944 (191.8515625MB) used = 128766432 (122.80123901367188MB) free = 72404512 (69.05032348632812MB) 64.0084643635216% used |
堆内存dump
jmap -dump:format=b,file=xxx.hprof 进程Id
作者:Work Hard Work Smart
出处:http://www.cnblogs.com/linlf03/
欢迎任何形式的转载,未经作者同意,请保留此段声明!
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决