标签:style blog http color io 使用 ar for 文件
在Linux内核 2.6.16中引入了一个系统内存接口特性,这个接口位于/proc/$pid/目录下的smaps文件中 ,一看内容发现是进程内存映像信息,比同一目录下的maps文件更详细些。
400df000-4048c000 r--s 00000000 1f:05 286 /data/dalvik-cache/system@framework@core.jar@classes.dex Size: 3764 kB Rss: 1804 kB Pss: 1804 kB Shared_Clean: 0 kB Shared_Dirty: 0 kB Private_Clean: 1804 kB Private_Dirty: 0 kB Referenced: 1804 kB Anonymous: 0 kB Swap: 0 kB KernelPageSize: 4 kB MMUPageSize: 4 kB
以上述输出结果为例:400df000-4048c000 r--s 00000000 1f:05 286 /data/dalvik-cache/system@framework@core.jar@classes.dex
其中Dirty页面如果没有交换机制的情况下,应该是不能回收的。
精确分析内存占用可以用Private内存信息来衡量。
详细解释见 http://www.kernel.org/doc/Documentation/filesystems/proc.txt
The first of these lines shows the same information as is displayed for the mapping in /proc/PID/maps. The remaining lines show the size of the mapping (size), the amount of the mapping that is currently resident in RAM (RSS), the process‘ proportional share of this mapping (PSS), the number of clean and dirty private pages in the mapping. Note that even a page which is part of a MAP_SHARED mapping, but has only a single pte mapped, i.e. is currently used by only one process, is accounted as private and not as shared. "Referenced" indicates the amount of memory currently marked as referenced or accessed. "Anonymous" shows the amount of memory that does not belong to any file. Even a mapping associated with a file may contain anonymous pages: when MAP_PRIVATE and a page is modified, the file page is replaced by a private anonymous copy. "Swap" shows how much would-be-anonymous memory is also used, but out on swap.
标签:style blog http color io 使用 ar for 文件
原文地址:http://www.cnblogs.com/0616--ataozhijia/p/3999661.html