Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jan 2002 16:45:26 -0700
From:      Chad David <davidc@acns.ab.ca>
To:        Nate Williams <nate@yogotech.com>
Cc:        Kris Kennaway <kris@obsecurity.org>, hackers@FreeBSD.ORG
Subject:   Re: Amount of free memory available in system?
Message-ID:  <20020112164526.A27462@colnta.acns.ab.ca>
In-Reply-To: <15424.50454.973048.932329@caddis.yogotech.com>; from nate@yogotech.com on Sat, Jan 12, 2002 at 04:21:58PM -0700
References:  <15424.32963.768829.892783@caddis.yogotech.com> <20020112142534.D40866@xor.obsecurity.org> <15424.50454.973048.932329@caddis.yogotech.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jan 12, 2002 at 04:21:58PM -0700, Nate Williams wrote:
> > > Is there a simple sysctl or a command line utility I can use to
> > > determine how much free memory is available in a system?
> > > 
> > > I've got an embedded application that has *very* limited memory, and I
> > > was trying to figure out how much memory was available for the userland
> > > applications.
> > > 
> > > 'top' has something, as well as 'vmstat'.  Unfortunately, because of the
> > > limited amount of disk space available on this box, I don't have access
> > > to either one of those.
> > > 
> > > Is there a sysctl I can use to determine how much free memory is
> > > available on the box?
> > 
> > Why not look how top and vmstat calculate it and do that in your code.
> 
> I was hoping to get do 'sysctl foo.bar.bletch' to tell me information.

vm.stats.vm.v_free_count will give you a somewhat useful number.  As well
there are sysctls for active, inactive, and cached (and wired), which you
could use to get a more complete picture of whats going on.

`sysctl vm` dumps a lot of useful information.

I hope that helps.

-- 
Chad David        davidc@acns.ab.ca
www.FreeBSD.org   davidc@freebsd.org
ACNS Inc.         Calgary, Alberta Canada
Fourthly, The constant breeders, beside the gain of eight shillings
sterling per annum by the sale of their children, will be rid of the
charge of maintaining them after the first year. - Johnathan Swift

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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