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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to