RES = java heap + off heap + metaspace + direct buffers
off heap 包括:
thread stacks,
mapped files (libraries and jars)
JVM code itself
GC
JIT
等
- heap
jmap -heap pid
- metaspace
jstat -gc pid
-
thread stack
线程数量 * 线程大小
//每个线程栈大小
jinfo pid|grep Stack --color
//线程数量
jstack pid|grep tid|wc -l
-
direct buffers
jmc查看
DirectBuffer
-
mapped libs and jars:
pmap -x pid | grep ".so.*" | awk '{sum+=$3} END {print sum}'
pmap -x pid | grep ".jar" | awk '{sum+=$3} END {print sum}'
-
其他
启动参数添加:-XX:NativeMemoryTracking=detail
执行:jcmd pid VM.native_memory detail
网友评论