Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jan 2004 13:44:12 -0800
From:      Chris Pressey <cpressey@catseye.mine.nu>
To:        Jez Hancock <jez.hancock@munk.nu>
Cc:        david@fielden.com.au
Subject:   Re: showing total/free memory
Message-ID:  <20040129134412.79a4d86a.cpressey@catseye.mine.nu>
In-Reply-To: <20040129212907.GB23190@users.munk.nu>
References:  <401823B2.7050400@fielden.com.au> <20040128211153.GA40209@wopr.caltech.edu> <401828E8.5090907@fielden.com.au> <20040128135843.7d453814.cpressey@catseye.mine.nu> <401976FE.3040007@fielden.com.au> <20040129212907.GB23190@users.munk.nu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 29 Jan 2004 21:29:07 +0000
Jez Hancock <jez.hancock@munk.nu> wrote:

> On Fri, Jan 30, 2004 at 08:11:26AM +1100, Rowdy wrote:
> > Chris Pressey wrote:
> > 
> > >Well, I'm not sure if it works on 5.x, but you could try
> > >
> > >  /usr/ports/sysutils/muse
> > >
> > >Should be easier to parse than the other options.
> > >
> > >-Chris
> You could always output the results of dmesg at boot-time to a file -
> adding something like this:
> 
> dmesg > /var/log/dmesg.boot
> 
> to /usr/local/etc/rc.local.

This already happens, to /var/run/dmesg.boot

Not sure how to account for the discrepancy - presumably it's not
counting memory that can't be used under FreeBSD (possibly the 'wired'
memory, for the kernel, and some other stuff.)  If you really need the
real total memory on the machine (as opposed to what's available to the
operating system,) you should probably parse /var/run/dmesg.boot (which
isn't difficult - just grep for 'real memory' and take the fourth field
with e.g. awk '{ print $4 }'.)

-Chris



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040129134412.79a4d86a.cpressey>