memory usage分析

1、Check system overall memory

1-1 adb shell cat /proc/meminfo

在这里插入图片描述

1-2 adb shell dumpsys meminfo

在这里插入图片描述
在这里插入图片描述

Total memory distribution info

total PSS = cached pss + used pss (cached pss : adj >=900 process pss sum , used pss : adj <900 process pss sum)
total kernel = cached kernel + kernel
cached kernel : slab reclaimable + buffers + cached - mapped
kernel : slab unreclaimable + shmem + vmalloc + page tables + kernel stack

1-3 adb shell procrank

在这里插入图片描述

2 Check single process memory

2-1 adb shell dumpsys meminfo $pid

在这里插入图片描述
在这里插入图片描述
Java heap:
抓取hprof排查heap分布
Native heap:
使用malloc debug + adb shell am dumpheap $pid查看
在这里插入图片描述

2-2 adb shell system/bin/showmap $ pid

list memory detail of a process ,the data was collected from smaps
在这里插入图片描述

2-3 adb shell cat /proc/$pid/smaps

list memory detail of a process

3 Memory tracking by mlog

3-1 how to get mlog

/d/mlog : cat /d/mlog will update periodically(1s)
/d/dmlog : the last mlog (about last ~30s mlog)(it is also SYS_MEMORY_LOG in SWT/ANR/NE db)

3-2 mlog format

在这里插入图片描述

3-3 use TfMA tool to parsing mlog (get this tool from submit e-service request)

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/wzx311/article/details/130438085
今日推荐