Several distinguished memory
VSS- Virtual Set Size of virtual memory consumption (contains shared libraries occupy memory)
RSS- Resident Set Size actual physical memory (including shared libraries occupy memory)
PSS- Proportional Set Size of physical memory actually used (prorated shared libraries occupy memory)
SS- Unique Set Size process alone take up physical memory (does not include shared libraries occupy memory)
Generally footprint size following law: VSS> = RSS> = PSS> = USS
Monitoring - Memory
First, by Dumpsys to value
1、adb shell dumpsys meminfo
2, for more information: adb shell dumpsys meminfo tv.danmaku.bili or Pid
Second, with / system / xbin / procrank intuitive tool value
1、adb shell procrank
Three, top
1、top -d 1 | grep packageName
adb shell "top -d 1 | grep packageName"
On a single application memory footprint issues
# View the largest single application memory limit
adb shell getprop|grep heapgrowthlimit
Allocation of initial application starts after # memory
adb shell getprop|grep dalvik.vm.heapstartsize
# largest single java virtual machine memory limits
adb shell getprop|grep dalvik.vm.heapsize
应用如果不想在 dalvik heap达到heapgrowthlimit限制的时候出现OOM,需要在
Manifest中的application标签中声明 android:largeHeap=“true”,声明后应用
dalvik heap 达到heapsize的时候才会出现OOM!
注:设备的不一样 最大内存限制也可能不一样监控-CPU
监控-CPU
一、通过Dumpsys 来取值
1、adb shell dumpsys cpuinfo
二、top
1、top -d 1 | grep packageName
通过ps命令查看
ps | grep packageName
查看UID
一、通过查看packages.list
adb shell "cat /data/system/packages.list | grep tv.danmaku.bili"
二、查看status文件
adb shell cat /proc//status
此处的需要替换成自己的pid的值
监控-流量_需要查看 pid或者uid
一、通过查看对应uid目录下的tcp_rcv和tcp_snd两个人文件
1、adb shell cat /proc/uid_stat/uid/tcp_snd
2、adb shell cat /proc/uid_stat/uid/tcp_rcv
3、命令中的要替换成自己的uid
二、通过proc/net/xt_qtaguid/stats
1、adb shell cat /proc/net/xt_qtaguid/stats | grep
2、命令中的要替换成自己的uid
三、通过PID下面的net/dev
1、adb shell cat /proc//net/dev
2、命令中的要替换成自己的uid