From owner-freebsd-questions@FreeBSD.ORG Thu Oct 7 12:12:34 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 683E7106564A for ; Thu, 7 Oct 2010 12:12:34 +0000 (UTC) (envelope-from bennett@cs.niu.edu) Received: from mp.cs.niu.edu (mp.cs.niu.edu [131.156.145.41]) by mx1.freebsd.org (Postfix) with ESMTP id 2024C8FC18 for ; Thu, 7 Oct 2010 12:12:33 +0000 (UTC) Received: from mp.cs.niu.edu (bennett@localhost [127.0.0.1]) by mp.cs.niu.edu (8.14.3/8.14.3) with ESMTP id o97BDgUv017405; Thu, 7 Oct 2010 06:13:42 -0500 (CDT) Date: Thu, 7 Oct 2010 06:13:42 -0500 (CDT) From: Scott Bennett Message-Id: <201010071113.o97BDg0X017404@mp.cs.niu.edu> To: Bruce Cran , freebsd-questions@freebsd.org Cc: Bas Smeelen , vyaaghrah-nix@yahoo.com Subject: Re: Cache Memory in top command X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 12:12:34 -0000 On Wed, 29 Sep 2010 12:42:30 +0100 Bruce Cran wrote: >On Wed, 29 Sep 2010 08:57:09 +0200 >Bas Smeelen 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 >> > >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 * **********************************************************************