Re: Unconventional memory leak problem
Re: Unconventional memory leak problem
- Subject: Re: Unconventional memory leak problem
- From: "Tom Harrington" <email@hidden>
- Date: Tue, 5 Sep 2006 21:21:18 -0600
On 9/5/06, Rodney Kennedy <email@hidden> wrote:
I have something that appears like a memory leak with the
culprit allocations are related to drawing interface objects
such a NSTableView in 4 or so windows. This is a problem
when I run in a batch mode which induces a considerable amount of
screen drawing including rendering images. The odd thing is
when I interact with the running Application, such as click on
a window or activate or deactivate the application this induces
the AppKit deallocations. If I leave it alone as the active
application or it is not active the real and virtual memory uses
rise and the application will eventually crash.
This is not like a conventional memory leak since there are
deallocations.
I do run multiple threads but I put all drawing on the main thread.
It seems to be NSView related, induced by drawRect calls and it feels
like there needs to be periodic flushing required of something.
It sounds like autoreleased objects are not being released during your
"batch mode", but that interacting with the application is triggering
the event loop and freeing the objects.
The normal way to deal with something like that is to set up a local
autorelease pool within your processing loop, so that you can cause
your local autoreleased objects to be cleaned up at the end of the
loop instead of waiting for it to happen later.
--
Tom Harrington
email@hidden
AIM: atomicbird1
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden