Memory leak
billt-lxSQFCZeNF4 at public.gmane.org
billt-lxSQFCZeNF4 at public.gmane.org
Sun Dec 11 17:56:41 UTC 2005
Detecting it is really a matter of running the application and noticing that it is using more and more memory as time goes on. There are some compilers that try to detect it but to my knowledge there is no full proof way doing that.
Also simply because you are using more and more memory doen't mean you actually have a memory leak. For example a program I wrote kept a in memory btree structure to increase access speed. As information was looked and cached in the btree the amount of memory this app used increased. To an untrained user this looked exactly like a memory leak, but it wasn't since there was limits to the amount memory the app will use to cache the information and there was a way to retire unsed records.
Correcting it is finding the allocation error and correcting the code. Some allocation errors are so subtle that it is almost impossible to do it.
Most people faced with slow leaks will simply kill and restart the application once a day/week/month etc...
Bill
On Sun, Dec 11, 2005 at 12:28:13PM -0500, 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.
> John
> --
> 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