Arun Sharma said:
> "James E. Housley" <j...@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,
dy...@iquest.net      | it makes one look stupid
jdy...@nc.com         | and it irritates the pig.


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

Reply via email to