[Wolves] Progress report!!

James Turner james at turnersoft.co.uk
Sat Jan 10 22:14:04 GMT 2004


On Thursday 08 Jan 2004 8:07 pm, David Goodwin wrote:
> > Hi
> >
> > I used "free" on the command line to check on memory
> > usage and about half of the 512MB is used uP???? and
> > that was straight from booting up to the desktop with
> > no applications activated. Which command or
> > application can I use to check on which processes are
> > taking the memory and how do I free up some more??
>
> In terms of computers, the slowest thing is accessing data on a disk.
> Because of this, Linux attempts to cache as much data you've read from the
> disk as possible - so should you access the same file again, no disk reads
> are required, and performance is stellar. Try running Open Office, or
> Mozilla, once.... closing them down and then starting them up again -
> you'll find the second time will be a *lot* quicker - this is because the
> data is still held in memory, and all that was required as a bit of cpu
> work.

Here's some typical output from the "free" command:

             total       used       free     shared    buffers     cached
Mem:        514544     510120       4424          0      26136     285460
-/+ buffers/cache:     198524     316020
Swap:      2332004     102220    2229784

The figures on the top line show that almost all of the memory (512Mb) is 
being made use of (the kernel always keeps a small portion free for some 
reason that I forget at the moment). About 300Mb is used for buffers/cache 
(holding information that is on disc in memory to speed things up if it's 
needed - as described above), while the remainder is actually being used by 
processes (or the kernel).

The second line of output shows what the memory usage would be if the 
buffers/cache are subtracted from the "used" figure and added to the "free" 
figure. Typically upto about 60% of RAM is always used for buffers/cache 
(though this can be tuned using the /proc filesystem for specialist 
performance requirements).

The third line shows the amount of swap space (or "virtual memory") in use, 
which is stored on hard disc and is significantly slower than RAM (probably 
several hundred times slower on modern machines). The amount of swap used and 
the swap used compared to total memory are probably the best indicators of 
memory shortage or plenty. Memory shortage (eg swap space = memory used, or 
more) is characterised by frequent and noticable delays in performing tasks, 
accompanied by the hard disc light coming on, indicating that the swap space 
is being accessed.

On a newly rebooted machine, the "free mem" figure starts out high, then 
decreases to a small value as information is read from disc and kept in case 
it's needed again. This small amount of free memory remains fairly constant, 
though it may sometime increase temporarily (eg just after quitting an 
application or a user logging out). Sooner or later, the freed-up memory will 
either be re-used by programs or the kernel or absorbed into buffers/cache.
The "mem used excluding buffers/cache" figure may increase or decrease 
depending on the requirements of any programs that are running, usually upto 
a maximum of about 40% (unless you've changed the setting in /proc), 
following which swap space starts to be used.

(hope there aren't too many mistakes in this!)

James




More information about the Wolves mailing list