Re: free (command) memory question

From: David Wright (david_c_wright_at_hotmail.com)
Date: 07/12/04


Date: Mon, 12 Jul 2004 10:15:20 +0200

Paranoid about Spam wrote:

> I asked about a memory leak a few days ago, and was relieved to find the
> free command.
>
> I just ran the free command and it shows as follows:
> total used free shared buffers cached
> Mem: 516520 472164 44356 0 108500 218848
> -/+ buffers/cache: 144816 371704
> Swap: 1044216 0 1044216
>
>
> Does this mean that I actually have 371mb of free memory that's being
> used for cache and buffers? and 144mb that's actually being used by
> applications?

Not certain, I haven't analysed free before and man page doesn't explain the
output (VERY USEFUL!); but I did a quick analysis of the column headings
and the figures involved and:

NOTE: Display is in KB, /1024 for MB.

I would say that the first line means 461MB is used for the OS and App
caches etc. with 43.3MB free. Of the used memory 105MB is buffers and 213MB
is cached.

This should mean that (according to the second line) you have 141MB used by
applications, and it can call on another 363MB of physical memory for
programs.

And you have 1019MB of disk space allocated for Swap.

I would suggest, that the 363MB free for data/apps won't be 100% correct, I
would assume Linux always keeps a little physical memory for buffers and
cache, so I would expect it to start swapping before all of the additional
363MB are used, but I don't know what % (or preset amount) it would use as
a minimum for buffers and cache. I haven't delved that deeply into the
internal workings of the Kernel...

Hope that helps clear it up a bit. I think I have the figures right, at
least doing the calculations the way I have, the figures all add up... But
there again, I could be heading off at a tangent here ;-)

Dave



Relevant Pages

  • Re: Memory usage measurement
    ... not including cache and buffers. ... The closes I could come is with the free command. ... buffers/cache and Swap used column, ...
    (Ubuntu)
  • Memory usage measurement
    ... not including cache and buffers. ... The closes I could come is with the free command. ... physical ram as well as used swap space. ...
    (Ubuntu)
  • Re: Informix FAQ
    ... BTR is an attempt to quantify how much or little churning of the buffer ... That is deivided by the number of buffers in the cache and the ... The UBTR was a largely unsuccessful attempt to eliminate unused buffers from ... See you at the 2010 IIUG Informix Conference ...
    (comp.databases.informix)
  • RE: Informix FAQ
    ... portion of the cache was replaced. ... Here's my reasons for using pagreads and bufwrits. ... The other side of the BTR are the pagreads. ... Your pagwrits indicate that you wrote 2,620,000 buffers per hour to disk. ...
    (comp.databases.informix)
  • Re: 32-bit programs on Windows x64
    ... My system requires 4 GB to store its DFA pixel pattern ... THE AMOUNT OF RAM ON THE MACHINE IS COMPLETELY, TOTALLY UNRELATED TO THE AVAILABLE ADDRESS ... on thinking about physical memory as being an operational parameter in any of this? ... Note that the L2 cache is ...
    (microsoft.public.vc.mfc)