• 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: Why Wasn't Memory Collected?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why Wasn't Memory Collected?


  • Subject: Re: Why Wasn't Memory Collected?
  • From: Nick Zitzmann <email@hidden>
  • Date: Sat, 11 Jun 2011 23:45:06 -0600

On Jun 11, 2011, at 11:39 PM, Bing Li wrote:

> I add a sub-autoreleasepool immediately outside the method that created XML. Once if the XML is sent, the memory should be released, right? Now the amount of memory consumed is very limited, almost no change in Activity Monitor.
>
> So I guess sub-autoreleasepool is important. We should not depend on the most high level autoreleasepool to collect memory. Am I right?

No, you can depend on it to collect memory, but you need to run your own pools if you need to create and get rid of large amounts of temporary objects. And you're going to need to use Instruments' object alloc instrument to figure out where your code is creating large amounts of temporary objects. Do not use Activity Monitor as a profiling tool.

Nick Zitzmann
<http://www.chronosnet.com/>



_______________________________________________

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: 
 >Why Wasn't Memory Collected? (From: Bing Li <email@hidden>)
 >Re: Why Wasn't Memory Collected? (From: Nick Zitzmann <email@hidden>)
 >Re: Why Wasn't Memory Collected? (From: Bing Li <email@hidden>)

  • Prev by Date: Re: Why Wasn't Memory Collected?
  • Next by Date: Re: Why Wasn't Memory Collected?
  • Previous by thread: Re: Why Wasn't Memory Collected?
  • Next by thread: Re: Why Wasn't Memory Collected?
  • Index(es):
    • Date
    • Thread