RE: Memory Usage - Buffered vs. Cached


Subject: RE: Memory Usage - Buffered vs. Cached
From: Jan Zumwalt (jwzumwalt@neatinfo.com)
Date: Mon Dec 02 2002 - 16:34:32 AKST


The one other thing that might be worth mentioning is that caches typically
are managed by the OS and the programmer has no control over where or how
the actual memory is used. Buffers generally can be controlled by the
programmer and may be used for unique circumstances such as FIFO, LIFO,
Ring, etc.

FIFO = first data stored will be the next given back
LIFO = Last data stored will be the next given back (stack)
Ring = pointer to data is sequenced in a continuous manner

Jan Zumwalt

-----Original Message-----
From: aklug-bounce@aklug.org [mailto:aklug-bounce@aklug.org]On Behalf Of
Arthur Corliss
Sent: Monday, December 02, 2002 11:31 AM
To: Justin Dieters
Cc: aklug@aklug.org
Subject: Re: Memory Usage - Buffered vs. Cached

On Mon, 2 Dec 2002, Justin Dieters wrote:

>
> Hey, perhaps someone can shed a little light on this for me. None of
> the books I have mention it, and I haven't found a clear answer
> searching through google.
>
> What is Buffered and Cached memory? And what is the difference between
> the two? And am I correct in my understanding that this memory can be
> flushed out and used my processes that need it?
>
> I have 128 MB total in my server, and right now less than 6 MB free.
> But I have about 24 MB in buffered and 60 MB in cached. Is this
> something to worry about, or am I okay on RAM as long as my Swap doesn't
> get used?

Buffers are allocated by various processes to use as input queues, etc. A
simplistic explanation of buffers is that they allow processes to
temporarily
store input in memory until the process can deal with it.

Cache is typically frequently requested disk I/O. If multiple processes are
accessing the same files, much of those files will be cached to improve
performance (RAM being so much faster than hard drives).

Don't worry about the large cache figures, the kernel will automatically
decrease the cache pool to free memory for running processes as needed.
You *want* to see that cached figure as high as possible, since that
typically
results in better performance.

And, yes, you're correct, as long as you're not hitting swap much, it's
nothing to worry about.

        --Arthur Corliss
          Bolverk's Lair -- http://arthur.corlissfamily.org/
          Digital Mages -- http://www.digitalmages.com/
          "Live Free or Die, the Only Way to Live" -- NH State Motto

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Mon Dec 02 2002 - 16:35:11 AKST