Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Feb 2005 17:55:26 -0500
From:      Chuck Swiger <cswiger@mac.com>
To:        Erik Trulsson <ertr1013@student.uu.se>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Inactive memory
Message-ID:  <4209435E.5080302@mac.com>
In-Reply-To: <20050208222759.GA29360@falcon.midgard.homeip.net>
References:  <810a540e050208133310333144@mail.gmail.com> <20050208213612.GA29063@falcon.midgard.homeip.net> <810a540e050208134479b4e774@mail.gmail.com> <20050208222759.GA29360@falcon.midgard.homeip.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4209435E.5080302>