• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Memory Leak, part I
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Memory Leak, part I (From: John Love <email@hidden>)

  • Prev by Date: Re: Running a timer on a separate thread
  • Next by Date: Attributed string to HTML: invalid image URLs
  • Previous by thread: Re: Memory Leak, part I
  • Next by thread: Memory Leak, Part I
  • Index(es):
    • Date
    • Thread