From owner-freebsd-current@FreeBSD.ORG Sun Apr 20 00:49:53 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 0E01737B401 for ; Sun, 20 Apr 2003 00:49:53 -0700 (PDT) Received: from HAL9000.homeunix.com (12-233-57-131.client.attbi.com [12.233.57.131]) by mx1.FreeBSD.org (Postfix) with ESMTP id 402A543FE3 for ; Sun, 20 Apr 2003 00:49:51 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.9/8.12.5) with ESMTP id h3K7nm8M001944; Sun, 20 Apr 2003 00:49:48 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.5/Submit) id h3K7nmAM001943; Sun, 20 Apr 2003 00:49:48 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Sun, 20 Apr 2003 00:49:48 -0700 From: David Schultz To: Lucky Green Message-ID: <20030420074948.GA1666@HAL9000.homeunix.com> Mail-Followup-To: Lucky Green , freebsd-current@freebsd.org References: <20030420002940.GB46590@HAL9000.homeunix.com> <001701c306da$160920c0$6601a8c0@VAIO650> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001701c306da$160920c0$6601a8c0@VAIO650> 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 07:49:53 -0000 On Sat, Apr 19, 2003, Lucky Green wrote: > David wrote: > > ``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. > > Ah! That was not clear to me from reading the VM docs. It now appears > that the culprit is GBDE. Copying a 700MB file from the GBDE partition > to another drive causes the inactive memory to increase by roughly the > file size. Within about a minute after the copy has completed, the > inactive memory drops from over 700MB to about 500MB and remains there. > Which would explain why the server is running out of memory. Unmounting > the GBDE partition reduces the inactive memory down to 130MB, but still > does not appear to recover all memory used by the copying process. Unfortunately, it's not that straightforward. FreeBSD doesn't separate clean and dirty pages in the inactive queue. Many of the ``inactive'' pages in this case could be data from the large file you just copied, which would be clean and easily replaceable since they have not been modified in memory. With cp(1), this kind of caching by the VM system should not happen for files larger than 8 MB. A (perhaps unlikely) possibility is that GBDE uses some sort of specialized caching to mitigate the overhead of encryption. In any case, it's hard to conclude anything, since the system dynamically tunes the queue sizes based on demand and you can't determine the proportion of clean and dirty pages by looking at the size of the inactive queue. You're only out of memory when all of the pages are dirty. BTW, I assume you have no swap due to the security concerns you voiced previously. Surely you've considered using GBDE to implement a secure swap partition.