[X4U] Memory usage

Brian Medley bpm-lists-x4u at 4321.tv
Mon Mar 21 15:25:59 PST 2005


On Mon, Mar 21, 2005 at 03:19:25PM -0500, Richard Gilmore wrote:

> I was just checking out the Activity Monitor and noticed under
> system memory is lists, Wired, Active, Inactive and Free what's
> the difference between these? It also lists virtual memory is
> that the same as swap space?
> 
> Just curious

Active list: Pages currently resident in, and mapped to, physical
memory and recently accessed.

Inactive list: Pages currently resident in physical memory but
not recently accessed. These pages contain valid data but may be
unmapped at present.

Free list: Unmapped pages (no longer containing valid data) of
physical memory available to the system at no cost; also known as
the free pool.  These  pages are not associated with any address
space or VM object, and they are thus  free for immediate use.

When the number of pages on the free list falls below a threshold
(determined by  the size of physical memory), the pager attempts
to balance the queues. It does this  by pulling pages from the
inactive list. If the page has been accessed recently, it is
placed on the end of the active list (reactivated). If the page
has not been recently accessed, but the page has been written to,
the contents of this physical page are  paged out to the
associated backing store. If the page was neither access recently
nor written to and is not permanently resident (wired), it is
stolen (any current virtual  mappings to it are destroyed) and
added to the free list. Once the free list size  exceeds the
target threshold, the pager rests.

The kernel moves pages from the active list to the inactive list
if they are not  accessed; it moves pages from the inactive list
to the active list on a soft fault (see Paging Virtual Memory In
(page 19)).  When virtual pages are swapped out, the  associated
physical pages are placed in the free list. Also, when processes
explicitly  free memory, the kernel moves the affected pages to
the free list.

I believe wired means that the page can't be swapped to disk.
Looks like I didn't copy 'n paste enough ...

-- 
~`^`'~=-._.-=~'`^`'~=-._.-=~'^'~=-., \|/  (___)  \|/ _,.-=~'`^`
                                      @~./'O o`\.~@
      "Knowledge is Power"           /__( \___/ )__\  *PPPFFBT!*
         -- Francis Bacon               `\__`U_/'
 _.-=~'``'~=-._.-=~'``'~=-._.-=~'`^`'~= <____|'  ^^`'~=-.,__,.-=
~'^`'~=-._.-=~'`^`'~=-._.-=~'^'~=-.,__,.-==--^'~=-.,__,.-=~'`^`


More information about the X4U mailing list