From owner-freebsd-stable@FreeBSD.ORG Wed Jan 26 13:07:45 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D224106566B for ; Wed, 26 Jan 2011 13:07:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 012F18FC19 for ; Wed, 26 Jan 2011 13:07:45 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id AD15F46B0D; Wed, 26 Jan 2011 08:07:44 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D0C4B8A01D; Wed, 26 Jan 2011 08:07:43 -0500 (EST) From: John Baldwin To: freebsd-stable@freebsd.org Date: Wed, 26 Jan 2011 08:06:09 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <4D401192.3030400@it4pro.pl> In-Reply-To: <4D401192.3030400@it4pro.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201101260806.10084.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 26 Jan 2011 08:07:43 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: Bartosz Stec Subject: Re: top shows only half of realmem? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 13:07:45 -0000 On Wednesday, January 26, 2011 7:20:34 am Bartosz Stec wrote: > Guys, > > could someone explain me this? > > # sysctl hw.realmem > hw.realmem: 2139029504 > > top line shows: > > Mem: 32M Active, 35M Inact, 899M Wired, 8392K Cache, 199M Buf, 58M Free > > 32+35+899+8+199+58 = 1231MB > > Shouldn't that sum to all available ram? Or maybe I'm reading it wrong? > This machine has indeed 2GB of ram on board and showed in BIOS. > i386 FreeBSD 8.2-PRERELEASE #16: Mon Jan 17 22:28:53 CET 2011 > Cheers. First, don't include 'buf' as isn't a separate set of RAM, it is only a range of the virtual address space in the kernel. It used to be relevant when the buffer cache was separate from the VM page cache, but now it is mostly irrelevant (arguably it should just be dropped from top output). However, look at what hw.physmem says (and the realmem and availmem lines in dmesg). realmem is actually not that useful as it is not a count of the amount of memory, but the address of the highest memory page available. There can be less memory available than that due to "holes" in the address space for PCI memory BARs, etc. -- John Baldwin