Richard:
You are correct that "free -o" and "top" give the same output. But this form
of memory-usage reporting is not the best one to see (especially for a
beginner) -- it gives the impression that the system has less free memory
than it actually has. The reason is the treatment of cache and buffers.
As we know, Linux systems increase their efficiency by keeping the code and
data for recently-run processes in memory. This can cause substantial speed
improvements -- the quickest way to see this is to mount a new CD, do a
"find" on it, then do the same "find" again -- the second one will be all
but instantaneous, while the first one will take some econds to run.
But meminfo marks the memory that holds these processes as in use, even
though it is fully available to new processes that need to run. For a system
that has been running a long time, the amount of memory "used" in this way
can be substantial. My own main system, now running for 31 days, shows only
4 megs "free" memory (out of 128 megs). But if buffers and cache are taken
out, the amount of memory actually available jumps to 64 megs.
My complaint about top (and "free -o") is that is doesn't do the work for
you of computing this second number, the actual amount of memory available
for use. You can compute it yourself, from other numbers that are displayed
... but why should you? This sort of arithmetic is (part of) what computers
are supposed to do for you -- as the output of "free" (without any flags) does.
At 07:28 AM 1/20/00 +0000, Richard Adams wrote:
>> Actually, quite a bit less than "all". In particular, top doesn't report the
>> true amount of available RAM, that is, the amount available including cache
>> and buffers. Its reporting is equivalent to only the first of the two lines
>> that "free" reports. Those numbers are VERY misleading, especially on a
>> system that goeas a long time between reboots.
>>
>
>I dont quite understand why you say this, top gets its info from the same
>file as free itself which is /proc/meminfo, now i belive top shows memory
>in the same way as free -o.
>
>The buffers line is not shown, but then that information is given per
>program in tops output.
>
>As to the output being different, i dont see your point, if what you say is
>true, then you must be saying /proc/meminfo does not work properly after x
>days of uptime.
------------------------------------"Never tell me the odds!"---
Ray Olszewski -- Han Solo
Palo Alto, CA [EMAIL PROTECTED]
----------------------------------------------------------------