From time to time I ask myself what the different memory columns in top
mean. There are three of them in a regular GNU/Linux environment; VIRT
, RES
& SHR
:
So I figured I should write it down:
VIRT
The following is counted when calculating VIRT
:
- Application code
- Application data
- Shared libraries
- Swap usage
RES
The following is counted when calculating RES
:
- The non-swapped physical memory a task has used
Note that RES
is not CODE
+ DATA
(for details see http://stackoverflow.com/questions/7594548/res-code-data-in-the-output-information-of-the-top-command-why).
SHR
This is the memory a task potentially has shared with other tasks.