From owner-freebsd-hackers@FreeBSD.ORG Fri May 5 18:10:04 2006 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.ORG Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 088F516A416 for ; Fri, 5 May 2006 18:10:03 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F1C543D64 for ; Fri, 5 May 2006 18:10:02 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (kbczgz@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k45I9uun086717 for ; Fri, 5 May 2006 20:10:01 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k45I9uHQ086716; Fri, 5 May 2006 20:09:56 +0200 (CEST) (envelope-from olli) Date: Fri, 5 May 2006 20:09:56 +0200 (CEST) Message-Id: <200605051809.k45I9uHQ086716@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG In-Reply-To: <67beabb0605051007q601678e6w49cf15d17604d82b@mail.gmail.com> X-Newsgroups: list.freebsd-hackers User-Agent: tin/1.8.0-20051224 ("Ronay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Fri, 05 May 2006 20:10:01 +0200 (CEST) X-Mailman-Approved-At: Fri, 05 May 2006 18:10:42 +0000 Cc: Subject: Re: how to find the physical memory allocated to the kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-hackers@FreeBSD.ORG List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 May 2006 18:10:04 -0000 Bharma Ji wrote: > Is there any way to determine the physical memory(not the virtual address > space) being allocated to the kernel at any instant? The overall problem is > that once I allocate say 512 MB to the kernel (virutal address space) > through the config file at compile time, I want to figure out how much of > that space is actually being used when the machine is under load. > Thanks for any answers I'm not sure, but maybe you're looking for the difference between kvm_size and kvm_free? $ sysctl vm.kvm* vm.kvm_size: 1065353216 vm.kvm_free: 809500672 So, in this case the kernel is actually using 244 MB of its address space. If you're interested in physical RAM, maybe you should look at the difference between physmem and usermem: $ sysctl hw.*mem hw.physmem: 164016128 hw.usermem: 128507904 In this case the kernel is using about 34 MB of RAM. (Both output above is from the same machine.) Best regards Oliver PS: In case you're wondering, I'm using a sysctl wrapper script that allows wildcards: http://www.secnetix.de/~olli/scripts/sysctl.wrapper -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "C++ is to C as Lung Cancer is to Lung." -- Thomas Funke