令人惊讶的是,很难找到/procfs的全面文档。对于我的具体问题,我要看的是:cat /proc/1/statm (让我们使用pid=1,因为它似乎总是存在的)。我刚查了一下结果:
9370 954 341 210 0 727 0发布于 2013-04-16 23:37:13
这些文档在内核源代码中的Documentation/filesystems/proc.txt中。许多发行版通过一个包(例如Ubuntu下的linux-doc,在/usr/share/doc/linux-doc下安装文件)提供它。
以下是文档中对statm字段的描述:
Field Content
size total program size (pages) (same as VmSize in status)
resident size of memory portions (pages) (same as VmRSS in status)
shared number of pages that are shared (i.e. backed by a file)
trs number of pages that are 'code' (not including libs; broken, includes data segment)
lrs number of pages of library (always 0 on 2.6)
drs number of pages of data/stack (including libs; broken, includes library text)
dt number of dirty pages (always 0 on 2.6)这个过程在RAM中有954页。页面在您的系统中是4kB (它可以是异域体系结构或配置上的其他值;getconf PAGESIZE会确认它)。这比4MB还少一点。
这些文档并非详尽无遗。如果你找不到你要找的东西,试着在Linux周刊或者其他网站上搜索。如果你还找不到答案,使用源。
https://unix.stackexchange.com/questions/72685
复制相似问题