Chinaunix首页 | 论坛 | 博客
  • 博客访问: 362456
  • 博文数量: 157
  • 博客积分: 3001
  • 博客等级: 中校
  • 技术积分: 1330
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-06 13:47
文章分类

全部博文(157)

文章存档

2011年(1)

2010年(28)

2009年(124)

2008年(4)

我的朋友

分类: LINUX

2010-04-23 15:12:09

使用top命令通常会看到VIRT, RES, and SHR 这几个字段,那么它们又有什么具体的含义呢?
 
The difference among VIRT, RES, and SHR in top output
VIRT stands for the virtual size of a process, which is the sum of memory it is actually using, memory it has mapped into itself (for instance the video card's RAM for the X server), files on disk that have been mapped into it (most notably shared libraries), and memory shared with other processes. VIRT represents how much memory the program is able to access at the present moment.

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

 

阅读(1176) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~