From owner-freebsd-questions Thu May 2 16:55:21 2002 Delivered-To: freebsd-questions@freebsd.org Received: from rambo.simx.org (rambo.simx.org [194.17.208.54]) by hub.freebsd.org (Postfix) with ESMTP id 8040937B419 for ; Thu, 2 May 2002 16:55:18 -0700 (PDT) Received: from rambo.simx.org (rocky [192.168.0.2]) by rambo.simx.org (8.12.3/8.12.3) with ESMTP id g42Nt9a6057965 for ; Fri, 3 May 2002 01:55:10 +0200 (CEST) (envelope-from listsub@rambo.simx.org) Message-ID: <3CD1D1F9.2040905@rambo.simx.org> Date: Fri, 03 May 2002 01:55:37 +0200 From: "Roger 'Rocky' Vetterberg" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4.1) Gecko/20020314 Netscape6/6.2.2 X-Accept-Language: en-us MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: getting amount of ram with sysctl Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 Hi people, Im trying to get the total amount of ram in a machine using sysctl variables. I figured vm.stats.vm.v_page_size * vm.stats.vm.v_page_count should give me total ram, but it always end up a few megs short. For example, on a machine with 256M ram I get a total of 249M when I do the math with above mentioned sysctl values. I know ram is not always exactly what it says on the package, it can differ a few megs in any direction, but I feel like the numbers Im seeing when testing this on different machines are always atleast ~5-6M short of what it should be. I was thinking things like BIOS shadowing could steal a little ram, but I have tried turning everything like that off, and still it doesnt add up. Is sysctl showing the actual amount of ram in the machine, or is it showing the amount of ram available to the os? Am I missing something obvious? Anyone care to point out what I do wrong, or explain why there are always some ram not showing? -- R To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message