Re: Overcommitable memory??

From: Mitchell Blank Jr (
Date: Thu Mar 16 2000 - 18:59:51 EST

> > Swap isn't necessary. Swap is just a cheap and slow alternative to RAM
> > chips, that's why most people use it, hoping mostly inactive parts of
> > memory have to be implemented as swap, but swap isn't necessary. It is
> > quite possible to run production Linux systems without any swap. Been
> > there, done that.
> Interestingly, I have to reluctlantly accede. Performance is noticably
> better on my workstation without swap.

I really doubt that's true.

> total used free shared buffers cached
> Mem: 128000 124072 3928 20956 50004 43512
> -/+ buffers/cache: 30556 97444
> Swap: 258008 14192 243816
> Look .. it has 90MB free ram available and it chooses to swap out
> unused pages.

No, there's 4M of _completely_ free RAM, and alot of RAM being used for disk
buffers. The VM system thinks that disk is more likely to be referenced soon
than the memory it swapped out, so it prefers to keep them in RAM.

> This is great .. until I have to swap them back in again
> at ~ 1MB/s.

How fast can you replace the disk pages that are in cache if they weren't there?

> I need those pages infrequently, but more frequently than
> I need fresh ram.

Yes, but not as frequently as you're using that disk cache, so without the
swap you will be waiting on disk _more_.

A typical machine has a lot of processes that will sit unused for days or
weeks - a small amount of swap means that you get more RAM, usually for
cache. On my main work machine, 34 of 86 processes are essentially completely
swapped out - gettys on unused VCs, tcsh processes in xterms I haven't
touched in ages, a couple GNOME apps that are buried beyond everything.
Without that 17M of RAM that the swap buys me, this machine would be a lot
less responsive. Yes, if I suddenly started typing in one of those windows
there would be a second of delay while it got swapped back in, but if I
didn't have disk cache it would delay every time I ran "ls".


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:19 EST