[TriLUG] Understanding output of "free"

James LewisMoss dres at lewismoss.org
Fri May 3 20:24:39 EDT 2002


>>>>> On Fri, 3 May 2002 11:21:11 -0400 (EDT), Jeremy P <jeremyp at pobox.com> said:

 Jeremy> Can anyone explain what the kernel buffers/cache are used
 Jeremy> for, as displayed in the output of "free"?

 Jeremy> For example, one of my servers shows this: $ free -m
 Jeremy>              total used free shared buffers cached
 Jeremy> Mem: 885 872 12 501 371 156 -/+ buffers/cache: 344 540 Swap:
 Jeremy> 133 7 125

 Jeremy> (Yes, I know I need more swap.)

 Jeremy> At first glance, it looks like there's only 12 MB free
 Jeremy> memory, but if you subtract the buffers/cache amount, there's
 Jeremy> 540 MB free (344 used).  What's all that buffer memory being
 Jeremy> used for?

 Jeremy> Suppose an application requests more than 125 MB of memory,
 Jeremy> the total amount shown free. Will it "steal" extra memory
 Jeremy> from the buffers?  Or will it get out-of-memory errors?

Someone else answered this, but no.  It'll just grab memory from the
buffers or cache.

 Jeremy> Also, why does it only show 885 MB physical RAM even though
 Jeremy> the computer has a 1 GB DIMM installed?  The BIOS reports
 Jeremy> something like 992MB at the POST.  That's a difference of
 Jeremy> 107MB -- that's a lot!

There are several things to check out here.
1) Make sure the kernel is compiled to use that much mem (I think the
   default compile won't go beyond 3/4 of a gig or so  check me on
   this.)
2) Your bios might not be able to sense how much mem is in the machine
   and is telling linux the wrong value.  Add a "mem=1024M" option to
   the linux boot line.

 Jeremy> I'm trying to figure out whether this box really needs more
 Jeremy> physical RAM or not.  The extremely tight budget is becoming
 Jeremy> even tighter...

Doesn't look like it.

Jim

-- 
@James LewisMoss <dres at debian.org>      |  Blessed Be!
@    http://www.lewismoss.org/~dres     |  Linux is kewl!
@"Argue for your limitations and sure enough, they're yours." Bach



More information about the TriLUG mailing list