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

Re: NSTask objectalloc problem


  • Subject: Re: NSTask objectalloc problem
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 29 Apr 2010 09:18:49 -0700


On Apr 28, 2010, at 11:16 AM, Tom Foutz wrote:

I am trying to run a back-up type of unix script whenever a file
changes in the directory.  However, my implementation, when viewed in
"Instruments" with "ObjectAlloc", demonstrates an ever-increasing
number of living objects.

Isn't that because you're spawning new NSTasks in a tight loop, probably faster than they can complete? This type of situation is sometimes used as an attack called a "fork bomb" :)


Your problem might be that you're expecting -[NSTask launch] to be synchronous, i.e. wait for the task to complete. It isn't. If you want to block, you should call -waitUntilExit; although usually it's better to take advantage of NSTask's asynchronous nature and avoid clogging up your app's UI.

—Jens_______________________________________________

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: 
 >NSTask objectalloc problem (From: Tom Foutz <email@hidden>)

  • Prev by Date: Re: Help with threads and queues
  • Next by Date: Re: Help with threads and queues
  • Previous by thread: NSTask objectalloc problem
  • Next by thread: Re: NSTask objectalloc problem
  • Index(es):
    • Date
    • Thread