Re: Best way to find memory leaks
Re: Best way to find memory leaks
- Subject: Re: Best way to find memory leaks
- From: Yann Bizeul <email@hidden>
- Date: Fri, 25 Jun 2004 16:37:14 +0200
>
I ran the object alloc utility on my app and it turns out I have some
>
serious memory leaks, many (but not all) of which seem to be what I
>
thought were temporary strings allocated with the + (id) class methods
>
inside loops.
Those object should be deallocated when the current run loop is done...
>
For simplicity's sake, all my allocation uses the various + (id) xxx
>
class methods but it seems that an awful lot of stuff isn't getting
>
released. On a machine with 1 GB of ram, the program runs for about 10
>
minutes and then just stops. No "out of memory errors" but looking at
>
the bar charts in Object Alloc shows a few bars that are off the
>
charts for memory usage. Problem is Obj Alloc is useless for tracking
>
down the problem as the culprit usually has a cryptic name like
>
"libxxx 23".
Object Alloc show what kind of object is allocated, and how many of
them. You should be able to inspect thos object's centent with it, and
think about where you allocated them and when they are not deallocated.
Now, each time I use it, I never succeed getting a 0 count, do some
complex actions (counters up), then get 0 objects back.
I usually get negative or positive numbers, but not 0.
So I don't know when is the run loop end, and If dealloc occures at
*every* loop end, some advice is needed about this.
I should add that I start debug when the application should be *idle*
waiting for a keyboard or mouse event.
--
Yann Bizeul - yann at tynsoe.org
http://projects.tynsoe.org/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.