linux /proc/pid/smaps各字段含义

/proc/$PID/smaps

linux /proc/pid/smaps各字段含义_第1张图片
第一行:
08048000-080bc000 地址空间的开始地址 - 结束地址
r-xp 属性。前三个是rwx(读、写、可执行),如果不具有则为“-”。最后一个是p/s(私有/共享)
00000000 偏移量。如果这段内存是从文件里映射过来的,则偏移量为这段内容在文件中的偏移量。如果不是从文件里面映射过来的则为0.
03:02 If the region was mapped from a file, this is the major and minor device number (in hex) where the file lives.
13130 If the region was mapped from a file, this is the file number.
/bin/bash If the region was mapped from a file, this is the name of the file. This field is blank for anonymous mapped regions. There are also special regions with names like [heap], [stack], or [vdso]. [vdso] stands for virtual dynamic shared object. It’s used by system calls to switch to kernel mode.

Rss-Resident Set Size 实际使用物理内存(包含共享库占用的内存)
Rss=Shared_Clean+Shared_Dirty+Private_Clean+Private_Dirty
Pss 实际使用的物理内存(按比例包含共享库占用的内存)。比如四个进程共享同一个占内存1000MB的共享库,每个进程算进250MB在Pss。
Shared_CleanShared_DirtyPrivate_CleanPrivate_Dirty
(shared/private)共享和私有
一个页的clean字段表示没有更改此页,当发生换页时不用写回。dirty表示更改了此页,当发生换页时要写回磁盘。此处这四个值是遍历页表中各个页后得到的。
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.

你可能感兴趣的:(linux)