How do you determine the amount of system memory?

Paul Lussier p.lussier at comcast.net
Tue Jul 29 12:42:08 EDT 2008


"Ben Scott" <dragonhawk at gmail.com> writes:

> On Wed, Jul 16, 2008 at 11:11 PM, Paul Lussier <p.lussier at comcast.net> wrote:
>> I believe free reads /proc/meminfo.
>
>   Yah, and so, apparently, does the sysconf(3) POSIX library function.  :-/
>
> Why are you looking to find out how much memory there is?  Hardware
> asset inventory, system requirements check, system health monitoring,
> something else... ?  There may be an alternative approach for some
> things.

I'm trying to write a regression test that will fail if the amount of
memory reported is not equal to the amount of memory physcicall in the
system.  Since this is a known kernel bug, I'm looking for some
reliable means of determining the amount of memory in the system to
which I can compare the amount of memory reported by the kernel.  If
they don't match, the test fails, and we know we have a bad kernel.

In the long run, our goal is to have an automated kernel testing
framework that will download the latest kernel tarball, apply some
number of patches, build the kernel, build the kernel package, install
it on some number of systems of slightly differing hardware types,
reboot, then run a bunch of tests against that kernel.

Ironically, the hardest part of this whole thing has been reliably
determining the amount of memory in the system :)
-- 
Seeya,
Paul


More information about the gnhlug-discuss mailing list