想要让的/ proc / * / smaps输出匿名区域之和的/ proc / meminfo中AnonPages匹配跟踪实际的内存使用precisely [英] Want to make /proc/*/smaps output anonymous region sum and /proc/meminfo AnonPages to match to trace actual memory usage precisely

查看:1575
本文介绍了想要让的/ proc / * / smaps输出匿名区域之和的/ proc / meminfo中AnonPages匹配跟踪实际的内存使用precisely的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要看到每个进程的内存precise量
使用匿名页面,因为匿名内存不能为
换出,从而pcisely跟踪这种用法$ P $是很重要的。

获得匿名页的整个总和的一种方法是读/进程内/ meminfo中AnonPages

另一种方法是在其中匹配smaps文件加起来所有条目如下:


  • 没有名字

  • [栈]

  • [堆]

  • 的/ dev / zero的

  • 的/ dev / shm的/...

  • 搬迁部分private_dirty

      

    用于搬迁科会为每个进程更新,
      这使得一些private_dirty地区命名映射区域。
      精灵装载机似乎改变读取使用的mprotect /写属性
      做安置时,因此它是难以区分这样
      从数据部区域,以及制备
      它难以跟踪由每个进程这些使用
      观点


  •   

所以我想知道如何区分以上
  搬迁部分,以$​​ P $ pcisely跟踪匿名
  内存使用各个过程。


也许我们应该添加新条目在/ proc / * / smaps展示
匿名内存的每个部分的金额。

和我发现这个差异这是完成2010年10月,刚刚回答我的问题。

<一个href=\"http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=blobdiff;f=Documentation/filesystems/proc.txt;h=976de6e19dd821351c1e4b52f82c72139c9598d7;hp=a563b74c7aef400ccfcd8e5e0a10cd03b94523f1;hb=b40d4f84becd69275451baee7f0801c85eb58437;hpb=d16e15f5b029fc7d03540ba0e5fb23b0abb0ebe0\" rel=\"nofollow\">http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=blobdiff;f=Documentation/filesystems/proc.txt;h=976de6e19dd821351c1e4b52f82c72139c9598d7;hp=a563b74c7aef400ccfcd8e5e0a10cd03b94523f1;hb=b40d4f84becd69275451baee7f0801c85eb58437;hpb=d16e15f5b029fc7d03540ba0e5fb23b0abb0ebe0

<一个href=\"http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=blobdiff;f=fs/proc/task_mmu.c;h=da6b01d70f019506face0dae73f0b78c3200d299;hp=871e25ed006970667229eea95c56342836c53525;hb=b40d4f84becd69275451baee7f0801c85eb58437;hpb=d16e15f5b029fc7d03540ba0e5fb23b0abb0ebe0\" rel=\"nofollow\">http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=blobdiff;f=fs/proc/task_mmu.c;h=da6b01d70f019506face0dae73f0b78c3200d299;hp=871e25ed006970667229eea95c56342836c53525;hb=b40d4f84becd69275451baee7f0801c85eb58437;hpb=d16e15f5b029fc7d03540ba0e5fb23b0abb0ebe0


解决方案

我发现这个差异这是完成2010年10月,刚刚回答我的问题。

<一个href=\"http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=blobdiff;f=Documentation/filesystems/proc.txt;h=976de6e19dd821351c1e4b52f82c72139c9598d7;hp=a563b74c7aef400ccfcd8e5e0a10cd03b94523f1;hb=b40d4f84becd69275451baee7f0801c85eb58437;hpb=d16e15f5b029fc7d03540ba0e5fb23b0abb0ebe0\" rel=\"nofollow\">http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=blobdiff;f=Documentation/filesystems/proc.txt;h=976de6e19dd821351c1e4b52f82c72139c9598d7;hp=a563b74c7aef400ccfcd8e5e0a10cd03b94523f1;hb=b40d4f84becd69275451baee7f0801c85eb58437;hpb=d16e15f5b029fc7d03540ba0e5fb23b0abb0ebe0

<一个href=\"http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=blobdiff;f=fs/proc/task_mmu.c;h=da6b01d70f019506face0dae73f0b78c3200d299;hp=871e25ed006970667229eea95c56342836c53525;hb=b40d4f84becd69275451baee7f0801c85eb58437;hpb=d16e15f5b029fc7d03540ba0e5fb23b0abb0ebe0\" rel=\"nofollow\">http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=blobdiff;f=fs/proc/task_mmu.c;h=da6b01d70f019506face0dae73f0b78c3200d299;hp=871e25ed006970667229eea95c56342836c53525;hb=b40d4f84becd69275451baee7f0801c85eb58437;hpb=d16e15f5b029fc7d03540ba0e5fb23b0abb0ebe0

I want to see the precise amount of memory each processes use as anonymous page, because anonymous memory cannot be paged out, thus tracking this usage precisely is important.

One way to get the whole sum of anonymous page is to read /proc/meminfo AnonPages.

The other way is to add up all the entries in smaps file which matches follows:

  • no name
  • [stack]
  • [heap]
  • /dev/zero
  • /dev/shm/...
  • Relocated section 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

So I would like to know how to differentiate the above relocated section, and to precisely track the anonymous memory usage for each processes.

Maybe we should add new entry in /proc/*/smaps to show the amount of Anonymous memory for each section.

And I've found this diff which was done 2010 October, which just answer my question.

http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=blobdiff;f=Documentation/filesystems/proc.txt;h=976de6e19dd821351c1e4b52f82c72139c9598d7;hp=a563b74c7aef400ccfcd8e5e0a10cd03b94523f1;hb=b40d4f84becd69275451baee7f0801c85eb58437;hpb=d16e15f5b029fc7d03540ba0e5fb23b0abb0ebe0

http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=blobdiff;f=fs/proc/task_mmu.c;h=da6b01d70f019506face0dae73f0b78c3200d299;hp=871e25ed006970667229eea95c56342836c53525;hb=b40d4f84becd69275451baee7f0801c85eb58437;hpb=d16e15f5b029fc7d03540ba0e5fb23b0abb0ebe0

解决方案

I've found this diff which was done 2010 October, which just answer my question.

http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=blobdiff;f=Documentation/filesystems/proc.txt;h=976de6e19dd821351c1e4b52f82c72139c9598d7;hp=a563b74c7aef400ccfcd8e5e0a10cd03b94523f1;hb=b40d4f84becd69275451baee7f0801c85eb58437;hpb=d16e15f5b029fc7d03540ba0e5fb23b0abb0ebe0

http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6-stable.git;a=blobdiff;f=fs/proc/task_mmu.c;h=da6b01d70f019506face0dae73f0b78c3200d299;hp=871e25ed006970667229eea95c56342836c53525;hb=b40d4f84becd69275451baee7f0801c85eb58437;hpb=d16e15f5b029fc7d03540ba0e5fb23b0abb0ebe0

这篇关于想要让的/ proc / * / smaps输出匿名区域之和的/ proc / meminfo中AnonPages匹配跟踪实际的内存使用precisely的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆