jmap
此命令用来查看内存信息,实例个数以及占用内存大小
jmap
jmap -histo -F 27515 > ./log.txt
查看堆信息
jmap -heap 进程Id
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/
欢迎任何形式的转载,未经作者同意,请保留此段声明!