LWN.net Logo

Swap: an idea whose time has come, and gone.

Swap: an idea whose time has come, and gone.

Posted Mar 23, 2007 0:21 UTC (Fri) by mgedmin (subscriber, #34497)
In reply to: Swap: an idea whose time has come, and gone. by zooko
Parent article: Toward improved page replacement

In my experience it is less painful to recover from memory hogs filling up all the RAM when you have swap than when you don't. When there's no swap the machine often thrashes while being completely nonresponsive for tens of seconds until the OOM killer kicks in.

My experience may be somewhat outdated, though. I haven't tried running a swapless machine for quite a while now.


(Log in to post comments)

Swap: a useful system feature which could be improved.

Posted Mar 23, 2007 14:49 UTC (Fri) by k8to (subscriber, #15413) [Link]

You can get into some amount of thrashing when you have active processes and a lot of swap. This is by design of course, you want to keep them running, and you want to be able to run more than RAM strictly allows.

Despite this, even when deep into "thrash" recently (approximately 180% of ram in active use) my system remained functional. I could have logged in as root and killed off the offending process in 20 seconds or so. From an existing paged-out terminal I could have wiped it out in around 5-8 seconds. This is a lot better than it used to be. A lot better than some other operating systems I could name. But still it does slow the system down a lot.

This underscores an interesting issue. Many users do (or should) want swap to keep more memory available to programs. But desktop users don't really ever want to thrash. I wonder if there is any possible way to seperate these cases. I would allocate 4 gigs or more of swap if I thought it wasn't an invitation to thrashing. Perhaps some kind of governor application which notices the pattern and gives the user explicit choices? IE. prioritize the compile over all other programs (including my RSS reader and desktop search agent, which think they should run periodically), or perhaps "force app1 to suspend until app2 completes its run"...

Such a beast is probably writable, and it would help _me_, a desktop user who knows about system programming dorkery. I think it would not be very useful for the majority of linux users though, who run it on servers or may not have sophistication to make explicit decisions of this sort. Any thoughts?

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds