Memory Leak

James Wilkinson james at westexe.demon.co.uk
Thu Feb 10 18:14:22 UTC 2005


Hongwei Li wrote:
> I have a similar question as 2 above.  My system: 2.6.10-1.741_FC3
> The free command displays the free physical memory decreasing continuesly
> every minute or so:
> 
> # free
>              total       used       free     shared    buffers     cached
> Mem:       1035788    1017952      17836          0     296172      81224
> -/+ buffers/cache:     640556     395232
> Swap:      1052216       8120    1044096
> 
> # free
>              total       used       free     shared    buffers     cached
> Mem:       1035788    1017980      17808          0     296228      81244
> -/+ buffers/cache:     640508     395280
> Swap:      1052216       8120    1044096
> 
> # free
>              total       used       free     shared    buffers     cached
> Mem:       1035788    1018100      17688          0     296260      81300
> -/+ buffers/cache:     640540     395248
> Swap:      1052216       8120    1044096
> 
> Is it normal?  I don't know what will happen if the free memory goes to
> zero, but it seems that, in my system, it never goes to zero.

*Thoroughly* normal.

Linux, like modern Unix and NT, is written around the assumption that
free memory is unused memory. If it's buffering or caching the hard
drive, that could speed things up. This is generally a Good Thing.

Linux keeps around a little free memory in case it needs it in a hurry:
if it needs more, it reclaims the memory it used on hard drive buffers
and cache. Normally, it can just "forget" about what that memory was
doing before.

Linux can also use the swap file to keep relatively unused "pages" of
memory: if you want to use more than 1 GB of memory, the least used
pages will be written into swap. Sometimes Linux will write back
"program" memory to swap (or elsewhere) in order to keep frequently-read
files in cache.

(Yes, this is still oversimplified).

Happy?

James.
-- 
James Wilkinson       | Never drink coke in a moving lift: the motion and the
Exeter    Devon    UK | chemicals in coke produce hallucinations. People tend
E-mail address: james | to change into lizards and attack without warning, and
@westexe.demon.co.uk  | large bats usually fly in the window. Additionally,
                      | you begin to believe that lifts have windows.




More information about the fedora-list mailing list