From owner-freebsd-questions@FreeBSD.ORG Tue Feb 8 22:55:30 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 AD39416A4CE for ; Tue, 8 Feb 2005 22:55:30 +0000 (GMT) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B77F43D31 for ; Tue, 8 Feb 2005 22:55:30 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from localhost (localhost [127.0.0.1]) by pi.codefab.com (Postfix) with ESMTP id 9D9F35E47; Tue, 8 Feb 2005 17:55:29 -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 30373-01; Tue, 8 Feb 2005 17:55:28 -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 5F76F5E5E; Tue, 8 Feb 2005 17:55:27 -0500 (EST) Message-ID: <4209435E.5080302@mac.com> Date: Tue, 08 Feb 2005 17:55:26 -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: Erik Trulsson References: <810a540e050208133310333144@mail.gmail.com> <20050208213612.GA29063@falcon.midgard.homeip.net> <810a540e050208134479b4e774@mail.gmail.com> <20050208222759.GA29360@falcon.midgard.homeip.net> In-Reply-To: <20050208222759.GA29360@falcon.midgard.homeip.net> 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: Pat Maddox 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:55:30 -0000 Erik Trulsson wrote: > On Tue, Feb 08, 2005 at 02:44:39PM -0700, Pat Maddox wrote: > Memory normally moves along the following path: > > Wired -> Active -> Inactive -> Cached -> Free > > and then when it gets allocated and used it moves back to Wired. This is not exactly accurate: Active -> Inactive -> Free is better, with Wired and Cached being mostly seperate categories. > The difference between the categories is mainly that "Inactive" and > "Cached" memory still contains data that the system might be able to > reuse, while "Free" memory is completely free and unused. > In order to use Cached or Inactive memory it might need to be flushed > first, with Inactive probably being dirty and Cached probably not. > ("Active" memory is almost certainly dirty and is therefore somewhat > more expensive to reuse. Wired memory is typically the kernel text (executable code), any kernel modules which have been loaded, and dynamic kernel memory used for critical structures like the process table, descriptor table, VM page tables, which tend to be staticly allocated. The pager never touches these, they are always resident in RAM. More dynamic kernel data structures like the I/O buffer used for disk access, network buffers, and the like are also wired down, but the system will adjust the size and flush pages of data from open files and the like to disk depending on the situation. That pool of memory is the Cached category. The set of pages which have been accessed by processes "very recently" in the Active category. It includes dirty regions as well as program executable code (which are not dirty). -- -Chuck