User: Password:
|
|
Subscribe / Log in / New account

a better solution (for some cases)

a better solution (for some cases)

Posted Sep 30, 2005 9:33 UTC (Fri) by zooko (guest, #2589)
Parent article: Swap prefetching

A better solution (for me at least): turn off swap.

A few months ago I was frequently running into situations where swap thrash would drag my system to a standstill. I have 1 GB of physical RAM, so this was happening when a single process was attempting a very large computation. After minutes or hours of waiting, the process would grow beyond swap and the out-of-memory killer would start killing random (*) things. If the OOM chose well then the system would become usable again, else, not.

So one day as an experiment I turned off swap. Now when a process grows beyond my 1 GB physical RAM, it quickly dies. (Err, waitasecond, shouldn't the OOM killer do its horrible random slaying? Yet as I recall, it seemed to work better in this situation.)

Swap -- an idea whose time has come and gone.

Regards,

Zooko

(*) I know it's not random. Whatever. It isn't predictable to me, the user.


(Log in to post comments)

a better solution (for some cases)

Posted Sep 30, 2005 22:53 UTC (Fri) by job (guest, #670) [Link]

I second that. If I ever need more than a gigabyte om RAM, I'll simply buy another.
With 64-bit machines becoming mainstream, who cares?

a better solution (for some cases)

Posted Oct 6, 2005 13:19 UTC (Thu) by efexis (guest, #26355) [Link]

Agreed on the swap front. If a runaway process has a huge amount of swap space to eat through before dying, it can bring the system to a halt for an extended length of time. Trying to ssh in (if I don't already have an open connection), and then battling for enough memory and disk IO just to run the kill/killall command, is often impossible. So I tend to set a tiny swap, just for stuff that really doesn't need to be in memory, like 128meg or something. Now a runaway process won't cause a runaway system.

Not that it's a regular occurance, but with todays amounts of memory, this "1.5 x RAM" swap rule that people won't let go of, causes more harm than good.


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