When I go to the system monitor in Ubuntu, about 75% of the Memory is used and 45% of Swap is used. Why is the Swap used even when Memory is available? Doesn't Linux move data from Swap to Memory?
|
feedback
|
|
It can move it to the memory. In fact, you can disable swap entirely, OR set a "limit". Information: http://www.linuxvox.com/2009/10/what-is-the-linux-kernel-parameter-vm-swappiness/ How to check yours: How to set this value: The more Swappiness you set, the more the kernel will swap. So set it a LOW amount if you want to use your swap only when it is needed. (Note: When you set the limit, you have to be root!) | |||
|
feedback
|
|
Linux likes to keep data in both swap and cached in memory at the same time when the memory is available. If you look in the right place, you'll find that most, if not all, of the "swapped-out" data is also cached in main memory. Why? Idle RAM doesn't provide any benefit, but, by keeping the swap cached, the kernel gains a lot of flexibility:
| |||
|
feedback
|
|
Why would the system move data from swap to memory if that data hasn't been accessed and may never be accessed? That would require pointless disk I/O and waste physical memory. | |||
|
feedback
|