Memory leak

Peter plp-ysDPMY98cNQDDBjDh4tngg at public.gmane.org
Sun Dec 11 19:46:14 UTC 2005


On Sun, 11 Dec 2005 wildberger-iRg7kjdsKiH3fQ9qLvQP4Q at public.gmane.org wrote:

> On Sunday 11 December 2005 12:04 pm, billt-lxSQFCZeNF4 at public.gmane.org wrote:
>> Memory that is allocated using malloc or similar memory allocation system,
>> and not freed when it is no longer used.
> Now that I know what a memory leak is, my next question is:
> How does one know that one has a leak and how can one correct it.

For a known application (like Firefox) it is known roughly how much 
memory it will use as a maximum (say +/- 100%). If one sees it growing 
beyond that, usually slowly and over lots of use, then it is suspect of 
a memory leak. The growth can be seen in system table data (from /proc). 
One way to look at it is with the 'top' program. Another is 'ps' with 
suitable arguments. There are other more specialized tools for tracing 
memory leaks (used mostly by programmers). For example right now my copy 
of FF uses 53M RES, 10M SHR and 86M VIRT after 63 hours up but it is not 
growing (the size change by a few megs depending on what pages I open 
and close). These figures are from 'top'.

Peter
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list