From owner-freebsd-questions@FreeBSD.ORG Tue Feb 8 22:13:23 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 831BB16A4CE for ; Tue, 8 Feb 2005 22:13:23 +0000 (GMT) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 14ADE43D48 for ; Tue, 8 Feb 2005 22:13:23 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from localhost (localhost [127.0.0.1]) by pi.codefab.com (Postfix) with ESMTP id 5BF925E2D; Tue, 8 Feb 2005 17:13:22 -0500 (EST) Received: from pi.codefab.com ([127.0.0.1]) by localhost (pi.codefab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 30075-06; Tue, 8 Feb 2005 17:13:21 -0500 (EST) Received: from [192.168.1.3] (pool-68-161-50-112.ny325.east.verizon.net [68.161.50.112]) by pi.codefab.com (Postfix) with ESMTP id 1D9055E28; Tue, 8 Feb 2005 17:13:20 -0500 (EST) Message-ID: <4209397F.6010204@mac.com> Date: Tue, 08 Feb 2005 17:13:19 -0500 From: Chuck Swiger Organization: The Courts of Chaos User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Pat Maddox References: <810a540e050208133310333144@mail.gmail.com> <20050208213612.GA29063@falcon.midgard.homeip.net> <810a540e050208134479b4e774@mail.gmail.com> In-Reply-To: <810a540e050208134479b4e774@mail.gmail.com> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at codefab.com cc: freebsd-questions@freebsd.org Subject: Re: Inactive memory X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Feb 2005 22:13:23 -0000 Pat Maddox wrote: > Alright, that lets me know that it's not an entirely bad thing. It > does say, however, that it's fine as long as the free memory isn't > REALLY low. It did get down to 13MB though, as I said. Really low means less than 1 MB. That would indicate the VM system is under so much pressure that it can't maintain the minimum amount of free space it wants to have: vm.v_free_min: 378 vm.v_free_target: 1655 vm.v_free_reserved: 143 vm.v_pageout_free_min: 34 vm.v_free_severe: 260 These numbers are likely to be in 4K pages, 260 * 4K = 1040K ~= 1 MB, and will vary slighty depending on available physical RAM, kernel size, and probably the phase of the moon. :-) > So now I understand that it's alright for the free memory to be low. > I don't understand how the inactive, cache, and buffered memory are > used though. When a process uses up all the free memory, does it then > use some from inactive, or does it use swap? A process will start reusing inactive memory, which involves flushing data to disk and/or using swap, depending, but the VM system may well swap out pages from other processes instead (especially ones that have been idle for a long time). [ The VM pager uses LRU or actually NFU page selection algorithms with complex names like "second chance replacement via clock hand sweep, with working set size and global page-fault frequency modelling". :-) This is a complicated topic, and it starts becoming better to look at the code than to try to describe the algorithms in words. ] -- -Chuck