Date: Fri, 5 May 2006 20:09:56 +0200 (CEST) From: Oliver Fromme <olli@lurza.secnetix.de> To: freebsd-hackers@FreeBSD.ORG Subject: Re: how to find the physical memory allocated to the kernel Message-ID: <200605051809.k45I9uHQ086716@lurza.secnetix.de> In-Reply-To: <67beabb0605051007q601678e6w49cf15d17604d82b@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Bharma Ji <bharmaji@gmail.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605051809.k45I9uHQ086716>