分类: LINUX
2010-04-23 15:12:09
RES stands for the resident size, which is an accurate representation of how much actual physical memory a process is consuming. (This also corresponds directly to the %MEM column.) This will virtually always be less than the VIRT size, since most programs depend on the C library.
SHR indicates how much of the VIRT size is actually sharable (memory or libraries). In the case of libraries, it does not necessarily mean that the entire library is resident. For example, if a program only uses a few functions in a library, the whole library is mapped and will be counted in VIRT and SHR, but only the parts of the library file containing the functions being used will actually be loaded in and be counted under RES.
其中:
VIRT: 虚拟内存的大小,单位为kb,该进程自己认为自己使用了的内存的大小, 对应ps命令里面的VSZ
SHR : 共享的内存的大小,单位为kb,该进程可以与其它进程共用的资源占用的内存大小, 对应ps命令里面的RSS
RES : 该进程当前占用的物理内存的大小
三者之间的关系:
VIRT = RES + SWAP
该进程占用的私有的物理内存大小为: RES - SHR
命令:#top