[CentOS] swap being used?

Stephen Harris lists at spuddy.org
Sat Nov 1 16:15:02 UTC 2008


> I have a machine with 64GB of memory in our lab. We have memory
> demanding processes and natually swap gets used. However when these
> processes are gone and the system is idle, we still see swap being
> used. Is this normal behavior?

Perfectly normal.  If the pages that have been swapped out are not used
then the system won't bother paging them back in again; keeps even more
memory free for other uses.

For example, my small 360Mb machine:

  % free
               total       used       free     shared    buffers     cached
  Mem:        368844     330740      38104          0      14928     248348
  -/+ buffers/cache:      67464     301380
  Swap:       263160        560     262600


560K of swap in use even though there's 300Mb of free space; that 560K
is just not in active use, so is better off on disk than in RAM.

If you _really_ cared you could swapoff to force the pages back to RAM
and then swapon again.  But it's not worth it.

-- 

rgds
Stephen



More information about the CentOS mailing list