(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version

Best of the Newsgroups: linux memory usage


What is this stuff?

If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):


References: <0fbcdv8e9c3bsuiefgn27h4l2lukihaet8@4ax.com>
From: rodsmith@nessus.rodsbooks.com (Rod Smith)
Subject: Re: interpreting 'free' (memory) output
Date: Fri, 30 May 2003 14:54:03 GMT


Hate these ads?




In article <3ED639F3.FDE59021@sympatico.ca>,
        John-Paul Stewart <jpstewart@sympatico.ca> writes:
> Evan Cooch wrote:
>> 
>> I currently am running RH 7.3 on an old PIII box, with 256 MB RAM. The
>> machine basically works as a web and mySQL server.
>> 
>> I noticed the machine acting a bit sluggish (purely qualitative
>> assessment), so I ran 'free' to see how much memory is allocated, and
>> to what - I got the following response:

> [Note line wrapping adjusted from original post]
>  
>>              total       used       free     shared    buffers     cached
>> Mem:        255644     213792      41852          0     104976      63904
>> -/+ buffers/cache:      44912     210732
>> Swap:       264592      21436     243156
>> 
> Also, you have 104MB in buffers and 64MB in the cache.  (Last two
> columns of the first line.)  Those can be dumped to free up space for
> other things if needed.  So (as the second line says) you effectively
> have 210MB free and 45MB used after adjusting for cache and buffers. 
> It's really those second line figures that count, IMHO.



Just to elaborate a bit, the Linux kernel is designed to use most of the
available RAM for buffers and cache. Thus, few systems will have very
large numbers in the "free" column on the "Mem:" line of "free" output.
Mostly those numbers will be high immediately after booting, then drop as
you use the disk. As John-Paul Stewart says, it's the "-/+ buffers/cache"
numbers that are better indicators of how much RAM is in use.














Swap has a tendency to get used for storage when there's a "burst" in
demand for memory, and then stuff stays in swap if it's not needed again.
It looks like that's what's happened to the OP, with a small amount of
swap space being used (8.1%) and little RAM in use by programs (17.6%).
Of course, a dynamic look at memory use over time is more informative
than a single slice, but if this is typical, there's no need to add more
RAM to this system. If these numbers fluctuate a lot, with frequent
spikes in RAM use, then more RAM might help the system get through those
spike periods.



-- 
Rod Smith, rodsmith@rodsbooks.com
http://www.rodsbooks.com
Author of books on Linux, FreeBSD, and networking





Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them.

I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.




Comments


Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments

If you want a picture to show with your comment, go get a Gravatar


ad





/Bofcusm/2118.html copyright 1997-2004 (various authors) All Rights Reserved

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here


book graphic unix and linux troubleshooting guide

My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!





More:
       - Linux
       - Unix
       - Newsgroup




Unix/Linux Consultants
Skills Tests







My Favorites

Change Congress