Re: NSInvocation and Memory
Re: NSInvocation and Memory
- Subject: Re: NSInvocation and Memory
- From: Drew McCormack <email@hidden>
- Date: Thu, 28 Feb 2002 13:27:19 +0100
I've got a worker thread updating a progress bar in my main thread
through
an NSConnection. The progress bar can be updated hundreds possibly
thousands
of times. My App seems to be eating huge amounts of memory. When I
look at
my App using ObjectAlloc I see that there are many many NSInvocations
being
created. This makes sense, but its eating lots of memory. Am I doing
something wrong? Are there any good examples of doing what I'm talking
about. Any help is much appreciated.
Hmm. Try updating your progress bar less often. The screen only
refreshes about 60-80 times a second, ya know. :->
Short of that, it sounds like your NSInvocations aren't going away
when you're done with them. You may have a leak (make sure they are
released by everybody who retains them, at the appropriate time), or it
may be that they are autoreleased bu they accumulate in large numbers
before the autorelease pool pops (in which case you might avoid making
autoreleased objects in the first place, or you might use
NSAutoreleasePool to control the lifetimes of your objects).
If these possibilities are ruled out definitively, then you'll have
to be more specific...
You have remembered to create an autorelease pool for your worker
thread, right?
drew
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ...
Dr. Drew McCormack
Trade Strategist (www.trade-strategist.com)
Trading simulation software for Mac OS X
_______________________________________________
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.