You're not reading top's output wrong, but you're interpretting it wrong.
It's a common mis-conception that I've seen (literally) hundreds of times
in #linuxhelp on EfNet by people new to Linux.

Any time you hit the disk in Linux the results of that disk read are
cached in memory (RAM).  RAM is Linux is purposely filled up with extra
things like this to improve performance.  As soon as another process
actualy requires that RAM the disk-cache is cleared out (only as much as
needed) to make room for the process.  Basically, memory is constantly
full, and freed only when needed.

You needn't worry about processes sucking up too my RAM until you end up
actually swapping, which can be monitoried via the 'vmstat' command.

Hope this helps.

Justin Buist
Trident Technology, Inc.
4700 60th St. SW, Suite 102
Grand Rapids, MI  49512
Ph. 616.554.2700
Fx. 616.554.3331
Mo. 616.291.2612

On Fri, 31 Aug 2001, Frank Hilliard wrote:

> Jesse,
>
> Top says Mem: 513276K av, 361416K used, 151856K  free, 38080K buff,
> 183584K cached. So it looks as if the used and free memory adds up to
> the total memory. However, if I check this in KDE system guard and break
> it down some more, it turns out the application memory is only 142544 +
> buffered memory 38080 + cached memory 183616 = 364240Mb.
>
> So from this it appears that something is cashing RAM, or to put that
> another way, some process has acquired 183616Mb of RAM and is holding on
> to it. The reason I think this is in RAM not swap space on the
> harddrive, is that a reboot gets rid of the cached figure, wherever it is.
>
> Or am I just reading this wrongly?
>
> Frank Hilliard
> http://frankhilliard.com/
>
>
> >Hi Frank --
> >
> >>Something on my server is quietly caching RAM. It's now up to about
> >>350Mb having started two weeks ago around 125. Does postgreSQL cache
> >>memory? If so, how can one dump the cache?  BTW, I know it's not Cold
> >>Fusion doing the caching.
> >>
> >
> >What do you mean, "caching RAM"?  You might mean, caching *IN* RAM, which
> >would make more sense to me.  (Caching RAM seems like it would have a
> >negative performance effect -- not much of a cache! -- unless your RAM cache
> >was stored in...  well... RAM.  ;-)
> >
> >Second, what leads you to believe that some process is creating a cache on
> >your server?  Are you referring to the display in top which says "358400K
> >cached"?  If so, that is your file cache, which just indicates that you have
> >free RAM, so Linux automagically used that to store recently accessed files.
> >(It will be the first RAM freed if a need arises.)
> >
> >You might also mean that 350MB of your Swap space is being used.  If so,
> >that would indicate to me that some process is using hordes of RAM, which
> >should be obvious if you run "top" and sort by memory size.
> >
> >If you mean something else, describe it to us.
> >
> >TTYL,
> >
> >-Jesse-
> >
> >
> >--
> >
> >+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> >  Jesse Erlbaum ....................... CTO
> >  [EMAIL PROTECTED] ............. Vanguard Media
> >  v: 212.242.5317 x115 ...... New York City
> >+-+-+-+-+-+- http://www.vm.com/ +-+-+-+-+-+-+
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-linux%40houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_linux or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to