From owner-freebsd-questions@FreeBSD.ORG Wed Feb 9 00:09:24 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 E129016A4CE for ; Wed, 9 Feb 2005 00:09:23 +0000 (GMT) Received: from av7-1-sn1.fre.skanova.net (av7-1-sn1.fre.skanova.net [81.228.11.113]) by mx1.FreeBSD.org (Postfix) with ESMTP id 76EE143D53 for ; Wed, 9 Feb 2005 00:09:22 +0000 (GMT) (envelope-from ertr1013@student.uu.se) Received: by av7-1-sn1.fre.skanova.net (Postfix, from userid 502) id 4E3E637E4B; Wed, 9 Feb 2005 01:09:21 +0100 (CET) Received: from smtp2-1-sn2.hy.skanova.net (smtp2-1-sn2.hy.skanova.net [81.228.8.177]) by av7-1-sn1.fre.skanova.net (Postfix) with ESMTP id 3D74537E49 for ; Wed, 9 Feb 2005 01:09:21 +0100 (CET) Received: from falcon.midgard.homeip.net (h201n1fls24o1048.bredband.comhem.se [212.181.162.201]) by smtp2-1-sn2.hy.skanova.net (Postfix) with SMTP id C1BF237E47 for ; Wed, 9 Feb 2005 01:09:20 +0100 (CET) Received: (qmail 56062 invoked by uid 1001); 9 Feb 2005 00:09:20 -0000 Date: Wed, 9 Feb 2005 01:09:20 +0100 From: Erik Trulsson To: Chuck Swiger Message-ID: <20050209000919.GA56002@falcon.midgard.homeip.net> Mail-Followup-To: Chuck Swiger , Pat Maddox , freebsd-questions@freebsd.org References: <810a540e050208133310333144@mail.gmail.com> <20050208213612.GA29063@falcon.midgard.homeip.net> <810a540e050208134479b4e774@mail.gmail.com> <20050208222759.GA29360@falcon.midgard.homeip.net> <4209435E.5080302@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4209435E.5080302@mac.com> User-Agent: Mutt/1.5.6i 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: Wed, 09 Feb 2005 00:09:24 -0000 On Tue, Feb 08, 2005 at 05:55:26PM -0500, Chuck Swiger wrote: > 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. Active -> Inactive -> Cached -> Free is correct as far as I can tell. Wired might be separate, I am not 100% sure what goes there. > > >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. Considering that the amount of memory in the "Wired" state tends to vary quite a bit as the system runs it is certainly not all statically allocated. (On my system "Wired" memory is usually about 15MB right after booting, can go as high as 40MB, but usually hovers around 30 MB, and almost never goes below 25MB after the system has been in use for some time.) > > 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. No, that is not Cached memory. It might be "Buffered", but I am not sure exactly what goes in that category (it is however the only category whose size do not fluctuate as time passes.) > > 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). True. I based my explanation on the documents found at http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/vm.html and at http://www.daemonnews.org/200001/freebsd_vm.html -- Erik Trulsson ertr1013@student.uu.se