gpt4 book ai didi

android - 在android中查询 "dumpsys meminfo"

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:05:31 34 4
gpt4 key购买 nike

当我在 android 4.2 上运行“adb shell dumpsys meminfo”时,我得到的结果如下

                                 Shared  Private     Heap     Heap     Heap
Pss Dirty Dirty Size Alloc Free
------ ------ ------ ------ ------ ------
Native 28 8 28 16404 12256 3663
Dalvik 14062 10060 13736 20032 15254 4778
Cursor 0 0 0
Ashmem 0 0 0
Other dev 4762 9556 0
.so mmap 11699 1824 1500
.jar mmap 0 0 0
.apk mmap 368 0 0
.ttf mmap 811 0 0
.dex mmap 3736 0 0
Other mmap 114 16 32
Unknown 12064 544 12052
TOTAL 47644 22008 27348 36436 27510 8441

我已阅读 How do I discover memory usage of my application in Android? 的页面,但还有几个问题:

  • 为什么原生Pss,shared dirty private dirty 很小?
  • 堆大小应该小于 Pss?
  • 未知是什么意思?看起来很大。
  • 如果我想知道我的应用使用了多少内存,我应该使用哪些数据?总 Pss?但它不包括几乎为零的原生 Pss?

最佳答案

请引用问题How do I discover memory usage of my application in Android? .我还希望你引用Detail VSS,RSS,PSS,USS关联。最适合用于特定应用程序的数据是USS(唯一集大小)为

USS is the total private memory for a process, i.e. that memory that is completely unique to that process . USS is an extremely useful number because it indicates the true incremental cost of running a particular process. When a process is killed, the USS is the total memory that is actually returned to the system. USS is the best number to watch when initially suspicious of memory leaks in a process.

你可以通过 adb shell procrank | grep <your.package.name> 获得

关于android - 在android中查询 "dumpsys meminfo",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17921777/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com