Free memory seems low

Jim Barton jmb at patton.wpd.sgi.com
Thu Jan 31 03:01:50 AEST 1991


Having started life a long time ago as a kernel hacker, memory that
isn't allocated to the kernel in some way is "free", i.e., I (the
kernel) can go get it and use it for something else. So, I automatically
calculated the available space as that the kernel wasn't using for
something or hadn't been locked down.

It's quite correct that the memory is full of data and text for running
programs. Most of the time, alot of that memory isn't in use, since
daemons sleep most of the time, biod and nfsd daemons always execute in
the kernel, and working sets are in general much smaller than the actual
program size (there, I did it again. "in use" means that some program
has executed instructions or touched data on that page in the recent past).

The kernel doesn't bother with these pages unless it needs the memory
for something else. "Mr. VM" Mike Thompson says that one thing he does
to find out how much memory is really "free" is to run a program which
simply touches data larger than physical memory. This causes most other
pages to be paged out and allocated to that program. The program then
exits, and if you look quick before any daemons or window managers or
other things run than that memory will be totally "free".

In general, the kernel doesn't run the paging daemon (called 'vhand' in
a ps listing) unless memory gets tight, and it quits when a certain
minimum number of pages have been made available. This avoids any paging
system overhead unless you really need to page.

-- Jim Barton
   Silicon Graphics Computer Systems
   jmb at sgi.com



More information about the Comp.sys.sgi mailing list