Date: Wed, 31 Oct 2001 13:11:44 -0800 (PST) From: David Kirchner <davidk@accretivetg.com> To: <jritchie@panasas.com> Cc: <freebsd-questions@FreeBSD.ORG>, <jritchie777@yahoo.com> Subject: Re: Need to be able to determine amount of memory in system and turn off virtual memory... Message-ID: <20011031131105.Y44499-100000@localhost> In-Reply-To: <30489F1321F5C343ACF6872B2CF7942A1BE739@PIKES.panasas.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 31 Oct 2001 jritchie@panasas.com wrote: > Hello, > I am writing a program to test memory on FreeBSD, and have some > questions. I use sysctl to show me the amount of hw.physmem in the system, > and I am able to allocate through malloc more than the value given by > hw.physmem. In addition I commented out the swap device in the /etc/fstab > to turn off virtual memory, yet what I can allocate through malloc is the > same either way. The question is: > 1.) how do I determine reliably the amount of memory in the system > (and if possible how > much the kernel is taking away), > 2.) and how do I turn off virtual memory? > Any hints, suggestions, code snipets will be greatly appreciated! > Thanks, > J.Ritchie > System Programmer > Panasas Someone will correct me if I'm wrong, but I believe you'd need to use "calloc" instead of "malloc" in this case. Otherwise the memory is allocated but not actually used. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011031131105.Y44499-100000>