• 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: new to memory mgmt
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new to memory mgmt


  • Subject: Re: new to memory mgmt
  • From: Nick Zitzmann <email@hidden>
  • Date: Sun, 15 Feb 2004 17:03:11 -0800

On Feb 15, 2004, at 2:15 PM, pmcurry wrote:

Ah... how the intricate folds of memory management reveal themselves so slowly!
Somehow, I was under the impression I had to create an NSAutoreleasePool within any method where I would want to autorelease an object I created.

You do, if:
1. You run some method in another thread, using NSThread
2. Your program runs a loop that might generate numerous megabytes (or gigabytes) worth of temporary objects

#1 is mandatory, or else your program will leak memory continuously. #2 is usually not mandatory, although I've seen one loop generate several gigabytes worth of objects and then crash the program because the VM system sputtered out. It's always a good idea, though...

Nick Zitzmann
<http://seiryu.home.comcast.net/>
<http://www.freshlysqueezedsoftware.com/>
S/MIME signature available upon request

UNIX: Where /sbin/init is Job #1.
_______________________________________________
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: 
 >new to memory mgmt (From: pmcurry <email@hidden>)
 >Re: new to memory mgmt (From: Troy Dawson <email@hidden>)
 >Re: new to memory mgmt (From: pmcurry <email@hidden>)
 >Re: new to memory mgmt (From: "Louis C. Sacha" <email@hidden>)
 >Re: new to memory mgmt (From: pmcurry <email@hidden>)

  • Prev by Date: Re: Objective C language [NEWBEE QUESTIONS]
  • Next by Date: MORE: Setting hierarchy of NIB items
  • Previous by thread: Re: new to memory mgmt
  • Next by thread: Re: new to memory mgmt
  • Index(es):
    • Date
    • Thread