Re: Big malloc's

Michael Meissner (meissner@cygnus.com)
11 Feb 1997 17:17:16 -0500


Cameron MacKinnon <mackin@interlog.com> writes:

> John Carter <john@dwaf-hri.pwv.gov.za> writes:
>
> > My question is then...
> >
> > How do I write a program that will ask the kernel how much free
> > physical memory there is available to me without causing a lot of
> > swapping?
>
> How about checking the source code of vmstat? It's not setuid, so
> whatever it's doing, you can do too.

Or just parsing /proc/meminfo manually. Note, you will usually see the amount
of memory free as very tiny. This is because when there is free memory
available, the kernel uses the extra memory for caching files.

--
Michael Meissner, Cygnus Solutions (East Coast)
4th floor, 955 Massachusetts Avenue, Cambridge, MA 02139, USA
meissner@cygnus.com,	617-354-5416 (office),	617-354-7161 (fax)