Date: Fri, 03 May 2002 01:55:37 +0200 From: "Roger 'Rocky' Vetterberg" <listsub@rambo.simx.org> To: freebsd-questions@freebsd.org Subject: getting amount of ram with sysctl Message-ID: <3CD1D1F9.2040905@rambo.simx.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3CD1D1F9.2040905>