[Techtalk] memory used on ubuntu server

Daniel Pittman daniel at rimspace.net
Thu Feb 9 02:53:12 UTC 2012


On Tue, Feb 7, 2012 at 11:24, Anne Wainwright <anotheranne at fables.co.za> wrote:
> On Mon, Feb 06, 2012 at 08:56:20PM -0600, Gayathri Swaminathan wrote:
>> On Mon, Feb 6, 2012 at 2:20 PM, Anne Wainwright <anotheranne at fables.co.za> wrote:
>>
>> > Daily inspection of this message caused me to think that all was well.
>> > On the contrary. The percentage in question is of the RAM plus swap plus
>> > buffer as investigation with 'free' revealed. It was not the percentage
>> > of the installed RAM as I imagined.
>>
>> When it comes to verifying actual memory usage, I often trust vmstat
>> command more than free. The man page is vivid but here are the highlights:
>
> Thanks for expounding on the merits of vmstat which has given me an
> interesting half hour !
>
> For one off-list respondant, 'free' to me meant unused RAM. So I am off
> to the local computer emporium to buy some more. I don't know if there
> is any general rule but on normal running with no real loads I like
> 50% headroom although that is not based on any real analysis.

You didn't actually mention which part of the output of `free` you
were looking at, and to save you the expense of buying more and more
memory:

The bit you care about is the intersection of the "free" column and
the "-/+ buffers/cache" line.

That tells you how much memory is being used on your server that isn't
just a copy of data that is also stored on disk - kept in RAM for
performance.

Linux will fill up almost every free bit of memory with disk cache,
but unlike some other operating systems it doesn't report that as
"free" by default.

As an example, from my server:

daniel at ki:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          8006       7955         50          0         95       6476
-/+ buffers/cache:       1383       6622
Swap:         8191          7       8184

50MB "free", but about 6.5GB of disk cache ... so it has more than
enough memory free at the moment.

Daniel
-- 
♲ Made with 100 percent post-consumer electrons


More information about the Techtalk mailing list