linux poison RSS
linux poison Email

What is 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 or other 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.




2 comments:

Anonymous said...

If VIRT is what you say it is, then how is it possible that in many cases VIRT is less than RES? It's also visible on the very screenshot you attached: policykit-kde ~0.6M VIRT and 13M RES. (What drives me nuts is that no mater how much I Google for this, everyone describes VIRT vs RES like you do, yet nobody puts the question I do. I must miss something very obvious... what is it?)

Anonymous said...

Anonymous: it is reported in kb, so the "60000" next to policykit-kde means it is using 60mb "virt", which is still more than 13m "res".

Post a Comment

Related Posts with Thumbnails