一、jmap -heap参数
C:\Users\admin>jmap -heap 187748
Attaching to process ID 187748, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.131-b11
using thread-local object allocation.
Parallel GC with 8 thread(s) 8个GC线程并行
Heap Configuration:
MinHeapFreeRatio = 0 //JVM最小空闲比率,可有-XX:MinHeapFreeRatio=<n>参数设置,JVM heap 在使用率小于n时,heap进行收缩
MaxHeapFreeRatio = 100 //JVM最大空闲比率,可有-XX:MaxHeapFreeRatio=<n>参数设置,jvm heap在使用率大于n时,heap进行扩张
MaxHeapSize = 2122317824 (2024.0MB) //jvm最大 堆大小,可有-XX:MaxHeapSize=<n>参数设置
NewSize = 44564480 (42.5MB) //jvm新生代大小,可有:-XX:NewSize=<n>参数设置
MaxNewSize = 707264512 (674.5MB) //jvm新生代最大大小,可有-XX:MaxNewSize=<n>参数设置
OldSize = 89653248 (85.5MB) //JVM老年代默认大小,可有-XXOldSize=<n>参数设置
NewRatio = 2 //新生代:老年代的比例大小=1:2,可有-XX:NewRatio=<n>设置
SurvivorRatio = 8 //survivor:eden = 1:8,即survivor space一共有两个,每一个站新生代的1/10,-XX:SurvivorRatio=<n>参数设置
MetaspaceSize = 21807104 (20.796875MB) //元空间默认大小,超过此值就会触发full gc,可有-XX:MetaspaceSize=<n>参数设置
CompressedClassSpaceSize = 1073741824 (1024.0MB) //类指针压缩空间的 默认大小,可由-XX:CompressedClassSpaceSize=<n> 参数设置
MaxMetaspaceSize = 17592186044415 MB //员工间最大大小,可有-XX:MaxMetaspaceSize=<n>参数设置
G1HeapRegionSize = 0 (0.0MB) //使用G1垃圾收集器的时候,堆被分割的大小 可由-XX:G1HeapRegionSize=<n>参数设置
Heap Usage:
PS Young Generation //新生代区域分配情况
Eden Space: //Eden区域分配情况
capacity = 398458880 (380.0MB)
used = 315743152 (301.1161346435547MB)
free = 82715728 (78.88386535644531MB)
79.24108806409333% used
From Space: //其中一个survivor区域分配情况
capacity = 21495808 (20.5MB)
used = 9688600 (9.239768981933594MB)
free = 11807208 (11.260231018066406MB)
45.07204381431021% used
To Space: //两一个survivor区域的分配情况
capacity = 20447232 (19.5MB)
used = 0 (0.0MB)
free = 20447232 (19.5MB)
0.0% used
PS Old Generation //老年区域的分配情况
capacity = 108003328 (103.0MB)
used = 36353256 (34.669166564941406MB)
free = 71650072 (68.3308334350586MB)
33.65938501450622% used
32671 interned Strings occupying 3700704 bytes.
二、jmap -histo 187748
打印每个类型的示例个数及占用空间大小,按占用空间有大到小的顺序排列。
jmap -histo:live 187748 打印存活的对象信息,会进行一次full GC