Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Possible Duplicate:
Should Swap be used like this?

I am running a WHM/cPanel VPS server with the monitoring program munin. Please have a look at this chart: enter image description here

Why is there memory swapping occurring when there is free memory and inactive memory? I imagine swapping means disk writing occurred as memory could not be allocated?

share|improve this question

marked as duplicate by mailq, Iain, Steven Monday, RobM, Scott Pack Oct 9 '11 at 21:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 0 down vote accepted

Swapping is used to increase the amount of free physical memory and improve performance.

When your computer starts up, a whole bunch of processes load. As these processes initialize, they allocate memory and modify its contents. Many of those processes will never, ever be used for the entire time the computer is running. Even for active processes, many of those pages of memory only contain initialization information that the process will never touch again.

The computer could keep that information in physical RAM forever. But that would be a complete waste as the data will never be used.

So the computer moves memory that has not been used for a very long time to swap. This creates more free physical RAM, which allows a larger disk cache and better performance.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.