From owner-freebsd-current@FreeBSD.ORG Sun Apr 20 02:43:19 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7587F37B401; Sun, 20 Apr 2003 02:43:19 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1768643FCB; Sun, 20 Apr 2003 02:43:18 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id TAA26787; Sun, 20 Apr 2003 19:43:15 +1000 Date: Sun, 20 Apr 2003 19:43:13 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: David Schultz In-Reply-To: <20030420002940.GB46590@HAL9000.homeunix.com> Message-ID: <20030420191744.G19683@gamplex.bde.org> References: <000501c30682$4e5e64b0$6601a8c0@VAIO650> <20030420002940.GB46590@HAL9000.homeunix.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Lucky Green cc: freebsd-current@freebsd.org Subject: Re: Broken memory management on system with no swap X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2003 09:43:19 -0000 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