Sometimes I have observed in Ubuntu's System Manager that without the physical RAM being used completely, the swap memory starts getting used.

Why is it so?

link|improve this question
There is a parameter called swappiness help.ubuntu.com/community/… which can be tweaked. A lightly loaded desktop with a GB of RAM can be set at 10 (out of 100). – aitchnyu Sep 15 '11 at 13:24
feedback

2 Answers

up vote 7 down vote accepted

From the Ubuntu Wiki Swap Faq

A significant number of the pages used by these large programs during its startup may only be used for initialization and then never used again. The system can swap out those pages and free the memory for other programs or even for the disk cache. In these cases, swap will be used to help the system handle any extra load.

I feel that the linux kernel does this optimally, and quite well, so you need not worry at all. You could reduce swappiness to increase your RAM usage, but I would not recommend that.

link|improve this answer
feedback

The OS sends pages to swap just in case. It does this so that if swap is needed it can remove the "swapped" pages from memory without the delay of writing them to disk.

I have no proof of this, but I would assume it does this when it has some spare time, so it can do it without impacting normal operations.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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