• 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: timers and background memory management
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: timers and background memory management


  • Subject: Re: timers and background memory management
  • From: Allan Odgaard <email@hidden>
  • Date: Fri, 1 Feb 2002 02:48:59 +0100

On torsdag, januar 31, 2002, at 07:51 , Matt Neuburg wrote:

> My app generates a lot of timers (NSTimer), and it runs in the background.

Maybe you could re-use them instead of instantiating new ones all the time (as this certainly has an overhead, even when autoreleasing works)?

> [...] So is there a way to jog the autorelease process and force them to be
> released even in the background? Thx - m.

You can setup your own auto release pool like this:
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

And then release it (and all objects added to the pool in between) like this:
[pool release];

Effectively this is probably what the NSRunLoop does when your application is active. Have a look at "Programming topic: Memory Management" for more details.

Regards Allan
--
http://www.diku.dk/students/duff/


  • Prev by Date: Re: reading in text files
  • Next by Date: ProgressIndicator: Chasing Arrow missing in cocoa?
  • Previous by thread: Re: reading in text files
  • Next by thread: Re: timers and background memory management
  • Index(es):
    • Date
    • Thread