It says

   p: SWAP  --  Swapped size (kb)
  The non-resident portion of a task's address space.

   q: RES  --  Resident size (kb)
  The non-swapped physical memory a task has used.


Okay, what does "non-resident portion" mean?

Does SWAP mean that hard disk is used as additional memory?

2 Answers 2


Yes, swap is when the hard disk is used to hold memory once RAM is full; on Linux it's normally held in a separate swap partition, but can use files. Mac and Windows use files on the regular filesystem. Paging excess memory out to disk like that keeps the OS from having to kill processes to free up real RAM, which is why it is generally recommended to have a swap partition for your Linux installation. However, it's a great deal slower (several orders of magnitude) than real RAM, which is why it's only used as a last resort (and why so much time is put into figuring out which page [4kB chunk of memory] to send to swap).

  • What does non resident mean then?
    – user4951
    Feb 16, 2013 at 16:13
  • @JimThio Same thing, non resident in memory. i.e in swap/disk
    – Matt
    Feb 16, 2013 at 16:20
  • @JimThio non-resident describes the memory while it is on the hard disk, i.e. not resident in physical RAM.
    – Kevin
    Feb 16, 2013 at 16:57

Besides your configured paging devices, swap also counts pages that come from files mapped in with mmap. These pages are only actually loaded into physical RAM when they are referred to by the program. These pages will be paged out to the original file rather than to the swap devices if they ever need to be paged out.

paxdiablo explains this here: https://stackoverflow.com/questions/1972765/mmap-problem-allocates-huge-amounts-of-memory

Or see the mmap man page.

  • I don't think that value is accounted as OS swap though (unless using mmap in a way that it needs swap, like MAP_PRIVATE). Although an mmaped file can be functionally swapped out of memory when the kernel needs to, this doesn't involve a write to normal swap as the backing file already exists elsewhere on your file system. In my mind, no writes to swap = no swap usage.
    – Matt
    Feb 16, 2013 at 19:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .