Re: Broken memory management on system with no swap

From: Bruce Evans <bde_at_zeta.org.au>
Date: Sun, 20 Apr 2003 19:43:13 +1000 (EST)
On Sat, 19 Apr 2003, David Schultz wrote:

> On Sat, Apr 19, 2003, Lucky Green wrote:
> > There appears to be a memory management bug that affects systems without
> > swap files. Processes are killed off due to the server being "out of
> > swap space" even though top shows some 800MB of "inactive" memory
> > available.
>
> ``Inactive'' just means that the page just hasn't been accessed
> for a while and is a candidtate for replacement.  However, on a
> system without swap, the system has nowhere to send the page if it
> is dirty.  The only pages that can always be discarded and reused
> are those in the ``Cache'' and ``Free'' categories.
>
> So the bottom line is that you really are running out of memory.

So the bug is mainly in vm making only a relatively useless statistic
available.  On my systems, `Inact' is usually mainly for (non-dirty)
VMIO pages.  The system has little difficulty discarding these, so
I haven't had problems with processes being killed despite not using
(much | any) swap since memories became cheap enough a few years ago.

'Buf' is another relatively useless statistic.  It means the amount
of virtual memory reserved for buffers, so it always has the per-boot
constant value (nbuf * BKVASIZE) and never tells you how much disk
contents is cached in buffers like it does on other systems.  FreeBSD
caches most disk contents in VMIO pages anyway, so the amount in buffers
would be another wrong thing for top to display (this amount is only
useful for seeing how badly the buffers are thrashing).  I read
`Inact' as an approximation for the correct value of 'Buf'.  systat
doesn't do much better than top here, since the relevant statistics
are not tracked by vm or vfs_bio.

Bruce
Received on Sun Apr 20 2003 - 00:43:19 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:04 UTC