From owner-freebsd-questions Wed Oct 31 13:11:55 2001 Delivered-To: freebsd-questions@freebsd.org Received: from webs1.accretive-networks.net (webs1.accretive-networks.net [207.246.154.13]) by hub.freebsd.org (Postfix) with ESMTP id CD83E37B403 for ; Wed, 31 Oct 2001 13:11:49 -0800 (PST) Received: from localhost (davidk@localhost) by webs1.accretive-networks.net (8.11.1/8.11.3) with ESMTP id f9VLBi844607; Wed, 31 Oct 2001 13:11:44 -0800 (PST) Date: Wed, 31 Oct 2001 13:11:44 -0800 (PST) From: David Kirchner X-X-Sender: To: Cc: , Subject: Re: Need to be able to determine amount of memory in system and turn off virtual memory... In-Reply-To: <30489F1321F5C343ACF6872B2CF7942A1BE739@PIKES.panasas.com> Message-ID: <20011031131105.Y44499-100000@localhost> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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