• 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: AutoreleasePools and Threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AutoreleasePools and Threads


  • Subject: Re: AutoreleasePools and Threads
  • From: Nathan Day <email@hidden>
  • Date: Thu, 4 Jul 2002 21:54:12 +0930

I don't think it will make much difference, someone correct me if this is wrong, but a autorelease pool just tells every individual object to release, it doesn't have some trick to release them all in one go like a single block of memory. Maybe if you did something with zones you could change that, don't know. Putting off releasing your autorelease pool will only change when your code spends time to release objects not how much time. Playing around with some code recently I found that -[NSObject alloc] was returning me addresses to memory that I had just released, so releasing frequently could in fact improve performance, it would certainly reduce the chance of paging. Even it it is a problem like most optimization I wouldn't worry about it unless you have a performance that you think could be fixed by it.

On Thursday, July 4, 2002, at 01:34 PM, Kevin Perry wrote:

Hi, in an application that I'm working on, there's a method detached in another thread. Of course, in that method, an autorelease pool is created as per necessity. However, in that method, there's a while() loop that repeats indefinitely that creates a lot of autoreleased objects that will never get released because the pool is released after the while() loop. I've got a half-decent solution to create another autorelease pool at the begin of the while loop and to release it at the end of the loop. However, I don't believe this frequent allocing and releasing of objects is as efficient as it could be. Is there a better solution for this that I have failed to notice?
_______________________________________________
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: 
 >AutoreleasePools and Threads (From: Kevin Perry <email@hidden>)

  • Prev by Date: Cocoa installer with Authorization Services
  • Next by Date: Re: Combo box doubts
  • Previous by thread: Re: AutoreleasePools and Threads
  • Next by thread: Re: AutoreleasePools
  • Index(es):
    • Date
    • Thread