LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Swap is being used even though RAM doesn't fill up on Slackware64 13.37 (http://www.linuxquestions.org/questions/slackware-14/swap-is-being-used-even-though-ram-doesnt-fill-up-on-slackware64-13-37-a-909830/)

alexjohnson 10-24-2011 10:14 AM

Swap is being used even though RAM doesn't fill up on Slackware64 13.37
 
I'm using Slackware64 13.37 and my swap space keeps getting used even though there is plenty of RAM that's still free.

I'm not sure if this is proper behavior but I would rather the RAM be filled up before the swap space starts getting utilized.

Is there any way to force this? My vm.swappiness (checked sysctl) is currently set to 60 (the default) so I'm not sure if this has to be changed.

Thanks.

macemoneta 10-24-2011 10:32 AM

The system balances RAM between kernel+application use and I/O buffers+cache. It changes the line dynamically to provide the best performance. If you'd like to stop that process or override it, you can change swappiness. At a setting of about 10, the system will try very hard not to swap, at the detriment of I/O. This is useful, for example, if you know that your I/O is of a highly serial nature and very rarely re-references data.

alexjohnson 10-24-2011 03:18 PM

I'm running it as a desktop and usually just browse the web, edit documents, etc. No server stuff involved.

It seems to me from you what replied that a value of 60 would be preferable for this kind of usage because it does actually re-reference data, like accessing the same webpages and opening/editing the same documents.

macemoneta 10-24-2011 03:34 PM

Yes, the default settings are optimal for typical usage. The pages that get swapped out are things that are occupying memory, but not being referenced, so putting them on swap frees additional RAM for productive use. Swap isn't a bad thing, unless it has a high I/O rate - that would indicate that your workload needs more RAM. As long as you're not seeing that, it's all good.

alexjohnson 10-24-2011 03:57 PM

OK, Thanks. I guess I'll stick with that.


All times are GMT -5. The time now is 07:02 AM.