Inactive memory

Chuck Swiger cswiger at
Tue Feb 8 14:55:30 PST 2005

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).


More information about the freebsd-questions mailing list