gpt4 book ai didi

android - 想让/proc/*/smaps输出匿名区域sum和/proc/meminfo AnonPages相匹配来精确追踪实际内存使用情况

转载 作者:太空宇宙 更新时间:2023-11-04 04:28:00 30 4
gpt4 key购买 nike

我想查看每个进程的精确内存量用作匿名页,因为匿名内存不能调出,因此精确跟踪此使用情况非常重要。

获取匿名页面总数的一种方法是读取/proc/meminfo AnonPages。

另一种方法是将 smaps 文件中匹配的所有条目相加:

  • 没有名字
  • [堆栈]
  • [堆]
  • /dev/零
  • /dev/shm/...
  • 重新定位了 private_dirty 部分

    Section used for relocation would be updated for each process, which makes some private_dirty region in a named mapping region. Elf loader seems to change read/write attribute using mprotect when doing relocation, so it is difficult to differentiate such region from a data section, and making it difficult to track these usage from each process point of view

所以我想知道如何区分以上重新定位部分,并精确追踪匿名每个进程的内存使用情况。

也许我们应该在/proc/*/smaps 中添加新条目来显示每个部分的匿名内存量。

最佳答案

关于android - 想让/proc/*/smaps输出匿名区域sum和/proc/meminfo AnonPages相匹配来精确追踪实际内存使用情况,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6885107/

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