Glenn Steen glenn.steen at
Wed Sep 6 08:55:07 IST 2006

On 06/09/06, Logan Shaw <lshaw at> wrote:
> On Tue, 5 Sep 2006, Glenn Steen wrote:
> > On 05/09/06, Ken A <ka at> wrote:
> >> Rob Poe wrote:
> >> >             total       used       free     shared    buffers     cached
> >> > Mem:        479644     447512      32132          0      93536     161792
> >> > -/+ buffers/cache:     192184     287460
> >> > Swap:      2112440       4356    2108084
> >> Looks like you are pushing it already at 2 children. More memory would
> >> help.
> > Ah, beg to differ, if but a tad...:-)
> > There is quite a bit of free memory there (both really free and
> > "readily returnable":-), so that isn't likely "it". The total is a bit
> > off from 512 MiB, which indicate that the machine have some memory
> > snitched by a "share memory" VGA adapter (or similar)... Install the
> > cheapest real VGA card you can find and disable the share-memory
> > thing, if possible. And get some more real RAM, a big swap is just a
> > crutch:-)
> Side issue, but IMHO a big swap is a way to turn one kind of
> negative consequences (running out of virtual memory) into
> another kind (system getting ridiculously slow).  So it's a
> value judgement whether it's worth having big swap or not.

Yes, well... The "divide" is "no swap"/"swap" (once you're heavily
into that swap, it's time to call your RAM supplier:-). A 2 GiB swap
on a system with 512 MiB RAM is usually (but not always) just a waste
of diskspace. Yeah yeah, disk is cheap, I know:-).

> > But that's neither here nor there. The tiny amount of swap used
> > doesn't really tell much.... "vmstat 2" is the tool to look to first,
> > to see if you have any swap in/out activity (I'm guessing you'll not
> > see much in that department:-).
> Speaking of which, memory issues are always confusing on modern
> operating systems with virtual memory (and the Linux "vmstat"
> documentation isn't much help), so is it safe to assume that
> vmstat's "si" and "so" columns are 0, then nothing is being
> read/written to swap space?  That would be a pretty good
> (but not perfect) indicator of relatively pressure for memory.

According to the Swordfish book (and my experience;), the "si" and
"so" fields of vmstat are the only ones worth looking at, with linux
vmstat. The other things are pretty much better covered by other
So yes, that is why one should always look at vmstat when one suspects
that the system has swapping activity. Oh, and remember to always
disregard the first line of junk (but you knew that:-).

> By the way, tiny amount of swap used should mean a pretty high
> probability of no swapping going on.  The converse isn't true
> (you can have lots of stuff residing in swap but nothing going
> back and forth between there and RAM), though.

Quite true. And having a lot of "unused cr*p" in swap is actually a
good thing, as that will free up memory for ... better use, and the
only real problem with swap is the slow I/O to/from it (compared to
memory). That is why looking at si/so is important, one could say:-).

-- Glenn
email: glenn < dot > steen < at > gmail < dot > com
work: glenn < dot > steen < at > ap1 < dot > se

More information about the MailScanner mailing list