Fwd: Max swap size?
plug.org at 2nerds.com
Thu May 29 12:33:58 MDT 2008
On Thu, May 29, 2008 at 12:24 AM, Stuart Jansen <sjansen at buscaluz.org> wrote:
> Although it is possible for Linux to run without any swap at all, doing
> so is less efficient. The Linux kernel will manage memory more
> aggressively when it knows that swap is available in an emergency.
One of my most-hated behaviors of many desktop *nix systems is (what
seems to be) a bias towards paging processes instead of reclaiming
cached filesystem data. As an interactive user, there's nothing I
hate more than waiting for an idle program to get paged back in.
Solaris fixed this bias problem a long time ago with a kernel-tunable
called priority-paging, which was introduced as a configuration option
and then later made the default, IIRC.
For years my main Linux machine has been a dual-cpu Opteron with 2GB
RAM. Because I hate process paging, I've run it since day one with NO
swap. I don't recall ever hitting the OOM killer. Since the kernel
can't page-out process memory, when memory is low it has no choice but
to reclaim pages devoted to the filesystem cache, which is exactly
what I want it to do--and what the old Solaris priority-paging option
set out to do. The machine in question is a typical developer desktop: it
runs a Perforce server, browser, lots of emacsen and xterms, and lots of
compiles with make's -j8 option. The absence of swap has never caused
the slightest grief. I don't necessarily recommend swapless operation
to others, but it's worked very well for me.
My biggest beef with my Macs is that they seem to suffer profusely
from the bias towards paging processes instead of filesystem cache.
My iMac has 3GB RAM but still pages things out like there's no
tomorrow. I'd turn off the swap on that machine, if I knew how, but
I'm not sure it's even possible to do so.
More information about the PLUG