Android常用内存分析命令
1.procrank
获取所有进程的内存使用的排行榜,按PSS排序
2.free
查看可用内存,单位KB
3.cat /proc/meminfo
查看系统整体内存情况,内存项按类型分类
MemAvailable ≈ MemFree+Buffers+Cached
每个进程的kernel stack 是16K,根据这个可以判断后台进程数
MemAvailable = free - kernel reserved memory + ative file + inactive file + SReclaimable - 2 * zone low water mark
Cached = All file page - buffers - swapping = Active file + Inactive file + Unevictable file - Buffers
Slab = SReclaimable + SUnreclaimable
Active = Active(anon) + Active(file)
Inactive = Inactive(anon) + Inactive(file)
AnonPages + Buffers + Cached = Active + Inactive
Buffers + Cached = Active(file) + Inactive(file)
SwapTotal = SwapFree + SwapUsed(Not SwapCached)
KernelStack = t