Memory stats on Linux

Did you ever wonder what the VIRT, RES and SHR memory figures in top on Linux are supposed to tell you?

Here we go:

  • VIRT – How much memory the process is able to access at the moment.
  • RES – How much memory the process is actually using at the moment. This is the value you should probably be looking at and corresponds with the %MEM column.
  • SHR – How much of the VIRT memory is shareable.

Continue here if you want more details:
http://mugurel.sumanariu.ro/linux/the-difference-among-virt-res-and-shr-in-top-output

A peek at the man page top might also help:

VIRT -- Virtual Memory Size (KiB)
 The total amount of virtual memory used by the task. It includes all code, data and shared libraries plus pages that have
 been swapped out and pages that have been mapped but not used.

RES -- Resident Memory Size (KiB)
 The non-swapped physical memory a task is using.

SHR -- Shared Memory Size (KiB)
 The amount of shared memory available to a task, not all of which is typically resident. It simply reflects memory that
 could be potentially shared with other processes.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.