From nobody@www.freebsd.org  Wed May 15 11:12:30 2002
Return-Path: <nobody@www.freebsd.org>
Received: from nwww.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by hub.freebsd.org (Postfix) with ESMTP id C8AFD37B416
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 15 May 2002 11:12:14 -0700 (PDT)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by nwww.freebsd.org (8.12.2/8.12.2) with ESMTP id g4FICEhG085985
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 15 May 2002 11:12:14 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.2/8.12.2/Submit) id g4FICEUx085984;
	Wed, 15 May 2002 11:12:14 -0700 (PDT)
Message-Id: <200205151812.g4FICEUx085984@www.freebsd.org>
Date: Wed, 15 May 2002 11:12:14 -0700 (PDT)
From: Norbert Papke <npapke@acm.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: New FAQ entry for memory states
X-Send-Pr-Version: www-1.0

>Number:         38117
>Category:       docs
>Synopsis:       New FAQ entry for memory states
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    murray
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          wish
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 15 11:20:01 PDT 2002
>Closed-Date:    Sun May 04 21:09:48 PDT 2003
>Last-Modified:  Sun May 04 21:09:48 PDT 2003
>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:
Responsible-Changed-From-To: freebsd-doc->ceri 
Responsible-Changed-By: ceri 
Responsible-Changed-When: Mon Oct 28 11:11:52 PST 2002 
Responsible-Changed-Why:  
This has been overlooked for too long. 
Remind myself to do this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=38117 
Responsible-Changed-From-To: ceri->freebsd-doc 
Responsible-Changed-By: ceri 
Responsible-Changed-When: Thu Jan 23 15:38:17 PST 2003 
Responsible-Changed-Why:  
Throw this back to the doc team. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=38117 
Responsible-Changed-From-To: freebsd-doc->murray 
Responsible-Changed-By: murray 
Responsible-Changed-When: Sun May 4 15:29:01 PDT 2003 
Responsible-Changed-Why:  
I will look at this one.  We should definitely add it to the FAQ. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=38117 
State-Changed-From-To: open->closed 
State-Changed-By: murray 
State-Changed-When: Sun May 4 21:08:48 PDT 2003 
State-Changed-Why:  
This change has been committed to the FAQ.  It may take up to 24 hours 
to reach the website.  Thanks very much for collecting this valuable 
usenet posting for us. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=38117 
>Unformatted:
