• 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 in Daemon
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory Leak in Daemon


  • Subject: Re: Memory Leak in Daemon
  • From: m <email@hidden>
  • Date: Mon, 19 Jul 2004 14:07:14 -0700

On Jul 19, 2004, at 1:36 PM, Kodex wrote:

I have been putting the finishing touches on my daemon and have noticed that i get a 1 MB memory leak each cycle through the loop that is added onto private memory. I am not sure how to release my pool or call dealloc in a deamon so i think that might be the cause. I have provided a link to my source code as well http://dragon-forged.com/memoryleak.txt just incase those arent the issues. Thanks guys!

Try another NSAutoReleasePool in your while loop:

while(keepGoing)
{
NSAutoreleasePool* innerPool = [[NSAutoreleasePool alloc] init];

// do your interesting stuff here...

[innerPool release];
}

That way the pool (and thus your Cocoa objects) is released each time through the loop instead of only when your daemon exits.

_murat
_______________________________________________
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.


References: 
 >Memory Leak in Daemon (From: Kodex <email@hidden>)

  • Prev by Date: Re: Memory Leak in Daemon
  • Next by Date: Re: Cocoa Bindings Question(s)
  • Previous by thread: Re: Memory Leak in Daemon
  • Next by thread: Finding out size of NSBitmapImageRep data pointer?
  • Index(es):
    • Date
    • Thread