• 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: NSTask memory leak
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask memory leak


  • Subject: Re: NSTask memory leak
  • From: Stefan Werner <email@hidden>
  • Date: Wed, 29 Nov 2006 20:36:04 +0100


On Nov 29, 2006, at 8:25 PM, Shawn Erickson wrote:

How long do these threads exists? How many objects get created while
the thread exits?

There is pretty much one thread per NSTask, and the thread's life time is barely longer than the NSTask. The thread launches an external app in the NSTask and communicates with it through BSD sockets, where the application's main thread handles the UI.


Review...
<http://developer.apple.com/documentation/Cocoa/Conceptual/ MemoryMgmt/Concepts/AutoreleasePools.html#//apple_ref/doc/uid/ 20000047-1041876-CJBFEIEG>

Thanks!

That one actually contained the real clue:
"If you create secondary threads using the POSIX thread APIs instead of NSThread, you cannot use Cocoa—including NSAutoreleasePool—unless Cocoa is in multithreading mode."


Of course. I knew there was something about Cocoa and threading. All of my threads are pthreads. I'll add a dummy NSThread to the launch of my app and see if that fixes it. Thanks again.

Is your C++ destructor getting called?

It is, yes. Was pretty much the first thing I checked.

Correct. Of course just because you have an autorelease pool in place
doesn't mean that that autorelease pool is getting drained in a
sensible fashion.

Right, but since the object in question was released explicitly instead of being autoreleased, this should not be the case there, or am I mistaken?


Thanks for your help,
Stefan_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: NSTask memory leak
      • From: Stefan Werner <email@hidden>
References: 
 >NSTask memory leak (From: Stefan Werner <email@hidden>)
 >Re: NSTask memory leak (From: "Shawn Erickson" <email@hidden>)
 >Re: NSTask memory leak (From: Stefan Werner <email@hidden>)
 >Re: Re: NSTask memory leak (From: "Shawn Erickson" <email@hidden>)
 >Re: NSTask memory leak (From: Stefan Werner <email@hidden>)
 >Re: Re: NSTask memory leak (From: "Shawn Erickson" <email@hidden>)

  • Prev by Date: Re: Re: NSTask memory leak
  • Next by Date: Chinese character handwriting recognition
  • Previous by thread: Re: Re: NSTask memory leak
  • Next by thread: Re: NSTask memory leak
  • Index(es):
    • Date
    • Thread