Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Apr 2003 19:43:13 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        David Schultz <das@freebsd.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Broken memory management on system with no swap
Message-ID:  <20030420191744.G19683@gamplex.bde.org>
In-Reply-To: <20030420002940.GB46590@HAL9000.homeunix.com>
References:  <000501c30682$4e5e64b0$6601a8c0@VAIO650> <20030420002940.GB46590@HAL9000.homeunix.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030420191744.G19683>