jmap(linux下特有,也是很常用的一个命令)
观察运行中的jvm物理内存的占用情况。
参数如下:
-heap:打印jvm heap的情况
-histo:打印jvm heap的直方图。其输出信息包括类名,对象数量,对象占用大小。
Attaching to process ID 129483, please wait... Debugger attached successfully. Server compiler detected. JVM version is 25.281-b09 using thread-local object allocation. Parallel GC with 8 thread(s) Heap Configuration: MinHeapFreeRatio = 0 MaxHeapFreeRatio = 100 MaxHeapSize = 2952790016 (2816.0MB) NewSize = 984088576 (938.5MB) MaxNewSize = 984088576 (938.5MB) OldSize = 1968701440 (1877.5MB) NewRatio = 2 SurvivorRatio = 8 metaspaceSize = 21807104 (20.796875MB) CompressedClassSpaceSize = 260046848 (248.0MB) MaxmetaspaceSize = 268435456 (256.0MB) G1HeapRegionSize = 0 (0.0MB) Heap Usage: PS Young Generation Eden Space: capacity = 865599488 (825.5MB) used = 865599488 (825.5MB) free = 0 (0.0MB) 100.0% used From Space: capacity = 38797312 (37.0MB) used = 0 (0.0MB) free = 38797312 (37.0MB) 0.0% used To Space: capacity = 59244544 (56.5MB) used = 0 (0.0MB) free = 59244544 (56.5MB) 0.0% used PS Old Generation capacity = 1968701440 (1877.5MB) used = 1968661696 (1877.4620971679688MB) free = 39744 (0.03790283203125MB) 99.99798120734853% used 86235 interned Strings occupying 9327368 bytes.
flink自己的统计如下
可以见到,老年区已经满了
histo文件如下num #instances #bytes class name ---------------------------------------------- 1: 65332 494301744 [B 2: 3088095 250997920 [C 3: 3438724 143310472 [Ljava.lang.Object; 4: 2511211 120538128 org.apache.kafka.common.metrics.stats.SampledStat$Sample 5: 1949856 109191936 java.util.linkedHashMap 6: 2192728 87709120 java.util.linkedHashMap$Entry 7: 3471700 83320800 java.util.ArrayList 8: 2226337 76536984 [Ljava.util.HashMap$Node; 9: 3086307 74071368 java.lang.String
其中的解释如下
前面出现[ 表述数组类型。出现[[表示二维数组类型。以此类推。
在histo文件中,是不可能出现基础类型的,因为基础类型不是对象。
这里以hprof文件为例子。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)