From owner-freebsd-questions  Tue Apr 23 18:42: 6 2002
Delivered-To: freebsd-questions@freebsd.org
Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101])
	by hub.freebsd.org (Postfix) with ESMTP id F141937B42A
	for <questions@FreeBSD.ORG>; Tue, 23 Apr 2002 18:41:53 -0700 (PDT)
Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1])
	by dan.emsphone.com (8.12.2/8.12.2) with ESMTP id g3O1fq9H016060;
	Tue, 23 Apr 2002 20:41:53 -0500 (CDT)
	(envelope-from dan@dan.emsphone.com)
Received: (from dan@localhost)
	by dan.emsphone.com (8.12.2/8.12.2/Submit) id g3O1fpO8016059;
	Tue, 23 Apr 2002 20:41:51 -0500 (CDT)
Date: Tue, 23 Apr 2002 20:41:51 -0500
From: Dan Nelson <dnelson@allantgroup.com>
To: Erin Fortenberry <efortenb@sdccd.cc.ca.us>
Cc: questions@FreeBSD.ORG
Subject: Re: Calculating memory in FreeBSD.
Message-ID: <20020424014151.GZ44176@dan.emsphone.com>
References: <BBDEEDD2EB67D311A0240008C74B93453A9108@ntxmidcity.sdccd.cc.ca.us>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <BBDEEDD2EB67D311A0240008C74B93453A9108@ntxmidcity.sdccd.cc.ca.us>
User-Agent: Mutt/1.3.28i
X-OS: FreeBSD 5.0-CURRENT
X-message-flag: Outlook Error
Sender: owner-freebsd-questions@FreeBSD.ORG
Precedence: bulk
List-ID: <freebsd-questions.FreeBSD.ORG>
List-Archive: <http://docs.freebsd.org/mail/> (Web Archive)
List-Help: <mailto:majordomo@FreeBSD.ORG?subject=help> (List Instructions)
List-Subscribe: <mailto:majordomo@FreeBSD.ORG?subject=subscribe%20freebsd-questions>
List-Unsubscribe: <mailto:majordomo@FreeBSD.ORG?subject=unsubscribe%20freebsd-questions>
X-Loop: FreeBSD.ORG

In the last episode (Apr 23), Erin Fortenberry said:
> 
> I am trying to calculate total memory in FreeBSD. I know of the five basic
> memory states, but I always seem to be missing between 3MB and 15MB.

hw.physmem is the closest you can get to total physical memory.
 
> Right now on a machine with 768MB of RAM I am showing 752.71MB using
> (vm.stats.vm.v_page_count + vm.stats.vm.v_page_size).
> 
> Can someone tell me what I am missing? Might this have something to do with
> vm.stats.vm.v_cache_count?

The kernel itself might not be counted here, and possibly other memory
used before the vm system starts up.

-- 
	Dan Nelson
	dnelson@allantgroup.com

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