Memory leak

Joseph Kubik josephkubik-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Sun Dec 11 21:38:51 UTC 2005


Another exiting and popular leak is a program that for some reason
opens sockets, or file handles of some sort and never releases the
pointer. The FD / point / socket desciptor are not very large, however
in some contexts a program cannot have more than a certian number of
file handles.
Sometimes netstat and lsof can help detect these types of leaks.
-Joseph-

On 12/11/05, Peter <plp-ysDPMY98cNQDDBjDh4tngg at public.gmane.org> wrote:
>
> 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
>
--
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