Re: Memory Leak, part I
Re: Memory Leak, part I
- Subject: Re: Memory Leak, part I
- From: Corbin Dunn <email@hidden>
- Date: Thu, 19 Feb 2009 16:46:42 -0800
Use Instruments instead; it will be much easier to find your memory
leaks.
corbin
On Feb 18, 2009, at 3:09 PM, John Love wrote:
[this is part I of a two-part plea for help]
I I have read Apple's "ManagingMemory.pdf" and am still having
difficulty understanding the use of MallocDebug which is detailed in
"MemoryMgmt.pdf". I have 5 methods in the generation of a
background thread and I cannot figure out where the memory leak is:
MallocDebug states that there is zero leakage for each of these
methods, but there is a leakage = 480 bytes in 24 nodes for
thread_start ????
(1)
- (void) startBgCalculation {
/*
setCalcStatus calls:
itsDictionary = [[NSThread currentThread]
threadDictionary];
[itsDictionary setValue:[NSNumber
numberWithInt:kCalculating] forKey:staticString#1];
*/
[self setCalcStatus:kCalculating];
[NSThread detachNewThreadSelector:@selector(bgCalcThread)
toTarget:self withObject:nil];
}
(2)
- (void) bgCalcThread {
NSAutoreleasePool *bgCalcThreadPool = [[NSAutoreleasePool
alloc] init];
[self doCalculation];
[self performSelectorOnMainThread:@selector(endBgCalculation/
*:*/)
withObject:nil
waitUntilDone:YES];
[bgCalcThreadPool release];
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden