Cache Memory in top command
Scott Bennett
bennett at cs.niu.edu
Thu Oct 7 12:12:34 UTC 2010
On Wed, 29 Sep 2010 12:42:30 +0100 Bruce Cran <bruce at cran.org.uk>
wrote:
>On Wed, 29 Sep 2010 08:57:09 +0200
>Bas Smeelen <b.smeelen at ose.nl> wrote:
>
>> *Cache:* number of clean pages caching data that are available for
>> immediate reallocation
>> http://www.freebsd.org/cgi/man.cgi?query=top&sektion=1
>> <http://www.freebsd.org/cgi/man.cgi?query=top&sektion=1>
>
>I believe the "Cache" value is almost totally unrelated to the
>amount of memory used for caching: FreeBSD has a unified buffer cache
>so any memory is available for use as cache. Unlike Linux, you can't
>look at the line in 'top' to see how much memory is being used for
>buffers and cache.
>
>You can find more information about the VM architecture at
>http://www.freebsd.org/doc/en/books/arch-handbook/vm.html .
>
The top(1) man page is clearly in error, at least on FreeBSD systems.
The descriptions of the Active, Inact, Wired, Cache, Buf, and Free fields
are all wrong inasmuch as the word "pages" in each should instead be "bytes".
For example, top on my system at present shows:
Mem: 1099M Active, 401M Inact, 262M Wired, 88M Cache, 112M Buf, 143M Free
Consider the value given for "Wired" (i.e., page-fixed pages, which cannot
exceed the number of page frames on the machine, of course.) Now, either
"M" has some extraordinary definition, or it means "mega", though presumably
in the classical computing sense of the power of 2 that is closest to one
million. My machine has 2 GB of RAM, so it is quite clearly an error to say
that there are 262 megapages (even assuming base pages (4 KB/page on i386
and amd64) and not superpages) on this machine. Note that 262 megapages
would be 4096 bytes/page * 262 * 1024 * 1024 pages) or 1048 GB, which I
suspect is rather more than FreeBSD kernels currently support, especially
in i386, which is what my system is running.
Scott Bennett, Comm. ASMELG, CFIAG
**********************************************************************
* Internet: bennett at cs.niu.edu *
*--------------------------------------------------------------------*
* "A well regulated and disciplined militia, is at all times a good *
* objection to the introduction of that bane of all free governments *
* -- a standing army." *
* -- Gov. John Hancock, New York Journal, 28 January 1790 *
**********************************************************************
More information about the freebsd-questions
mailing list