At 12:06 PM 6/12/99 -0700, David Rysdam wrote [in part]:
>No, I'm definitely leaking memory. From 18 MB free to 2 MB free in
>about 3 days.
>
>What's weird is no processes seem to be taking an undue amount of RAM.
>I just have high "cached" and "buffered" values (11 and 13
>respectively). I'm getting this info from 'cat /proc/meminfo'.
>
>When I reboot the same processes are running but the free memory shoots
>back up.
This is normal Linux behavior; it's not a memory leak. It's exactly what
Frank was trying to explain to you in his response. I'll try with a bit more
detail.
When a process finishes running (or releases a resource), the kernel will,
if possible, leave that process or resource in memory, in effect betting
that if you used it one, you'll want to use it again soon. Such memory
(depending on what it's holding) can be classified as "cached" or
"buffered". But if a new process needs eome memory, the kernel will reassign
some of this memory (using a dump-the-oldest-stuff-first algorithm, I think)
to the new process. It's available, just not *quite* free.
To see what's going on, run "free" and look at the difference between the
"free" entey on the first line and the one below it on the "+/- buffers"
line. The difference is the amount that's holding old stuff against future
uses but available if needed for something new.
When you reboot, of course, free memory seems to "shoot up" because the
buffered processes and data have been lost. Now the program or data will
have to be read afresh from the hard disk before it is run or accessed, a
slower process than using the RAM buffer.
BTW, to see how much this approach can improve perfoemance, try accessing a
file from something slow like a CD. As an example, if I make 2 copies of the
same bootdisk image, running dd separately for each one, the first will take
about 3 times as long as the second. The difference is that for the second,
the bootdisk image is already buffered in memory.
------------------------------------"Never tell me the odds!"---
Ray Olszewski -- Han Solo
Palo Alto, CA 94303-3603 [EMAIL PROTECTED]
----------------------------------------------------------------