Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 May 2002 11:12:14 -0700 (PDT)
From:      Norbert Papke <npapke@acm.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   docs/38117: New FAQ entry for memory states
Message-ID:  <200205151812.g4FICEUx085984@www.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         38117
>Category:       docs
>Synopsis:       New FAQ entry for memory states
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          wish
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 15 11:20:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Norbert Papke
>Release:        4.6-PRERELEASE
>Organization:
Proven Path
>Environment:
FreeBSD proven.2y.net 4.6-PRERELEASE FreeBSD 4.6-PRERELEASE #11: Tue May 14 16:58:29 PDT 2002     npapke@proven.2y.net:/usr/obj/usr/src/sys/NGP  i386
>Description:
In a recent discussion on comp.unix.bsd.freebsd.misc John S. Dyson <dyson@iquest.net> provided the following excellent description of memory states.  It should be added to the FAQ, possibly in "Chapter 16 - Misc Questions".  I have checked with John and he does not object to his answers being used in this manner.

Q: What do the various memory states displayed by 'top' mean?

A: 

Active:  pages recently statistically used.

Inactive:  pages recently statistically unused.

Cache:  (most often) pages that have percolated from inactive to a
status where they maintain their data, but can often be immediately
reused (either with their old association, or reused with a new
association.)   There can be certain immediate transition from
active to 'cache' state if the page is known to be clean (unmodified),
but that transition is a matter of policy, depending upon the
algorithm choice of the VM system maintainer.

Free:  pages without data content, and can be immediately used in
certain circumstances where cache pages might be inelegible.   Free
pages can be reused at interrupt or process state.

Wired:  pages that are fixed into memory, usually for kernel purposes,
but also sometimes for special use in processes.

Pages are most often written to disk (sort of a VM sync) when they
are in the 'inactive' state, but 'active' pages can also be synced
also (but require s the availability of certain CPU features.) This
depends upon the CPU tracking of the 'modified' bit being available,
and in certain situations there can be an advantage for a block of
VM pages to be synced, whether they are active or inactive.  In
most common cases, it is best to think of the 'inactive' queue to
be a queue of relatively unused pages that might or might not be
in the process of being written to disk.  'Cached' pages are already
'synced', not mapped, but available for immediate process use with
their old association or with a new association.   Free pages are
available at interrupt level, but cached or free pages can be used
at process state for reuse .  Cache pages aren't adequately locked
to be available at interrupt level.

There are some other flags (e.g. Busy flag or busy count) that might
modify some of the rules that I described.


>How-To-Repeat:
n/a
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




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