我尝试了adb shell top
,但它提供了太多详细信息。
我需要的只是总可用内存。如何通过亚行获得?
答案 0 :(得分:16)
为什么不内置::
$ adb shell "cat /proc/meminfo"
大多数手机缺少free
实用程序以及更多buzybox。另一方面,/proc/meminfo
是Linux的组成部分。
答案 1 :(得分:13)
最干净"清洁"我到目前为止发现的方式是adb shell vmstat
它提供如下信息:
procs memory system cpu
r b free mapped anon slab in cs flt us ni sy id wa ir
1 0 99120 55400 618680 25600 2207 4089 0 6 0 9 84 0 0
其中,99120
是以KB为单位的可用内存。
答案 2 :(得分:4)
如何使用busybox
?
adb shell busybox free -m
total used free shared buffers
Mem: 741 503 237 0 5
-/+ buffers: 498 242
Swap: 0 0 0
答案 3 :(得分:1)
您也可以看看dumpsys
例如adb shell dumpsys meminfo
示例输出
Applications Memory Usage (in Kilobytes):
Uptime: 466195106 Realtime: 1351644497
Total PSS by process:
358,901K: org.mozilla.firefox (pid 28883 / activities)
...
...
...
Total PSS by OOM adjustment:
420,346K: Native
125,116K: surfaceflinger (pid 734)
43,238K: logd (pid 488)
20,419K: mm-qcamera-daemon (pid 3307)
...
...
...
Total PSS by category:
649,878K: Native
407,027K: Dalvik
241,132K: Gfx dev
178,217K: Unknown
174,912K: GL mtrack
161,148K: EGL mtrack
129,137K: .art mmap
96,374K: Dalvik Other
91,936K: .apk mmap
67,291K: .dex mmap
63,269K: .so mmap
34,888K: Stack
25,226K: .oat mmap
5,967K: Other mmap
1,617K: Other dev
1,439K: Ashmem
894K: .jar mmap
68K: .ttf mmap
8K: Cursor
0K: Other mtrack
Total RAM: 3,868,864K (status normal)
Free RAM: 1,114,394K ( 907,794K cached pss + 38,964K cached kernel + 167,636K free)
Used RAM: 3,259,174K (2,762,994K used pss + 496,180K kernel)
Lost RAM: 358,896K
ZRAM: 285,780K physical used for 1,434,012K in swap (1,442,368K total swap)
Tuning: 256 (large 512), oom 558,304K, restore limit 186,101K (high-end-gfx)