From owner-freebsd-stable@FreeBSD.ORG Wed Jan 26 18:04:06 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 C7C11106566C for ; Wed, 26 Jan 2011 18:04:06 +0000 (UTC) (envelope-from marco@tolstoy.tols.org) Received: from tolstoy.tols.org (tolstoy.tols.org [IPv6:2a02:898:0:20::57:1]) by mx1.freebsd.org (Postfix) with ESMTP id 5B4A38FC0A for ; Wed, 26 Jan 2011 18:04:06 +0000 (UTC) Received: from tolstoy.tols.org (localhost [127.0.0.1]) by tolstoy.tols.org (8.14.4/8.14.4) with ESMTP id p0QI42Q2017354 for ; Wed, 26 Jan 2011 18:04:02 GMT (envelope-from marco@tolstoy.tols.org) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.96.5 at tolstoy.tols.org Received: (from marco@localhost) by tolstoy.tols.org (8.14.4/8.14.4/Submit) id p0QI42bG017353 for freebsd-stable@freebsd.org; Wed, 26 Jan 2011 19:04:02 +0100 (CET) (envelope-from marco) Date: Wed, 26 Jan 2011 19:04:02 +0100 From: Marco van Tol To: freebsd-stable@freebsd.org Message-ID: <20110126180402.GA17271@tolstoy.tols.org> Mail-Followup-To: freebsd-stable@freebsd.org References: <4D401192.3030400@it4pro.pl> <201101260806.10084.jhb@freebsd.org> <4D401F9C.6050402@it4pro.pl> <201101261235.56856.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201101261235.56856.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on tolstoy.tols.org 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 18:04:06 -0000 On Wed, Jan 26, 2011 at 12:35:56PM -0500, John Baldwin wrote: > On Wednesday, January 26, 2011 8:20:28 am Bartosz Stec wrote: > > W dniu 2011-01-26 14:06, John Baldwin pisze: > > > 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). > > > > Thanks for the explanation. So 1231MB - 199MB Buf and we got about 1GB > > of memory instead of 2B. > > > > > 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. > > > > > OK, here you go: > > # sysctl hw | grep mem > > > > hw.physmem: 2125893632 > > hw.usermem: 1212100608 > > hw.realmem: 2139029504 > > hw.pci.host_mem_start: 2147483648 > > Humm, you should still have 2GB of RAM then. All the memory you set aside > for ARC should be counted in the 'wired' count, so I'm not sure why you see > 1GB of RAM rather than 2GB. For what its worth (seems to be the same values top shows), the sysctl's I use to make cacti graphs of memory usage are: (Counts are in pages) vm.stats.vm.v_page_size vm.stats.vm.v_wire_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_cache_count vm.stats.vm.v_free_count Using the output of those sysctls I allways get a cacti graph which at least very much seems to account for all memory, and has a flat surface in a stacked graph. HTH, Marco van Tol -- Wanneer je in de afgrond kijkt, kijkt de afgrond ook in jou. - Friedrich Nietzsche