Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jun 1999 11:54:37 -0500 (EST)
From:      "John S. Dyson" <dyson@iquest.net>
To:        adsharma@home.com (Arun Sharma)
Cc:        jim@thehousleys.net (James E. Housley), hackers@FreeBSD.ORG
Subject:   Re: Inactive vs. free Memory
Message-ID:  <199906151654.LAA03905@dyson.iquest.net.>
In-Reply-To: <m3hfo9v4r4.fsf@c62443-a.frmt1.sfba.home.com> from Arun Sharma at "Jun 15, 1999 08:54:23 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Arun Sharma said:
> "James E. Housley" <jim@thehousleys.net> writes:
> 
> > Just for my infomation.  What is the difference between "Inactive" and
> > "Free" memory.  Right now top says I have 157M Inact and 3260K Free.
> 
> Inactive means the page contains valid data belonging to some file,
> but is not mapped into any address space. Free means, the page doesn't
> contain valid data.
> 
Trying to be helpful to follow up with more detail, but slightly
inprecise due to the fact that there are still some generalizations:

Active pages have been recently mapped into a process by the kernel,
	most often by virtue of a page fault.  Sometimes pages are activated,
	but not initially mapped, and that is a policy decision.

Inactive pages might or might not be mapped into a process recently, but
	those pages have likely been bumped from the Active list by the pageout
	daemon.  Sometimes the system will initially inactivate a page instead
	of activating it for policy reasons though.

Cache pages are not mapped into a process, but are left around for reuse with
	intact data.  Cache pages are VM cached, but a slightly confusing issue is
	that buffer cache pages are actually wired.  Cache pages are in the
	netherworld of being free and not-free, and can be used as BOTH empty or
	cache data.

Free pages have no data, and might or might not be prezeroed.

Wired pages are often directly used by the kernel, and are not available for
	involuntary reuse by the actions of the pageout daemon.

One of the improvements of FreeBSD VM over the old original code is that
it has an in-between form of "free" pages called "cache" pages, that are
available for immediate reuse both as empty pages or containing their
previous contents.  This allows for policy mistakes to be buffered further
than the LRU-K type algorithm used by the pageout daemon.  Adding the cache
queue made a significant improvement, over and above the LRU-K style
scheme.  (Note the FreeBSD implementation of LRU-K is particularly
efficient.)

-- 
John                  | Never try to teach a pig to sing,
dyson@iquest.net      | it makes one look stupid
jdyson@nc.com         | and it irritates the pig.


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




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