Death To Swap

Before kernel 2.4.10, the prevailing wisdom was to make your swap partition twice the size of your RAM.  With newer kernels, equal-to-RAM will do.

So let’s say my system has 256 MB RAM and I’m running 2.6.x.  I should make my swap 256 MB.  The maximum "memory" available is then 512 MB.  If some applications want more, too bad, that’s all there is.  Some process is going to meet the OOM killer.

Now I buy another 256 MB of RAM.  Now I really do have 512 MB of actual memory.  And I hate swap -- it’s slow as crap, and it seems it’s always the stuff I really want to use that ends up there.  So why even use a swap partition at all?  I was doing fine with 512 MB yesterday, and today, now that it’s all RAM and no swap, my 512 is even better.

The most memory-intensive thing I do is my weekly backup; since it caches every file it reads, and it reads every file on my system, my RAM and swap are instantly full.  The kernel doesn’t start killing off procs at that point, so it shouldn’t be any different if my memory is pure RAM and no swap.

From now on, I’m disabling my swap completely and seeing how it goes.  It’s 2004.  It’s about time.

Posted by Anthony on reply

Reply to this message here:

Your name
Email
Website (optional)
Subject

HomeCreate PostArchivesLoginCMS by Encodable ]