• 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: In-loop releasing of objects does not free memory?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: In-loop releasing of objects does not free memory?


  • Subject: Re: In-loop releasing of objects does not free memory?
  • From: "Shawn Erickson" <email@hidden>
  • Date: Wed, 13 Feb 2008 08:57:54 -0800

On Feb 12, 2008 5:10 PM, John Terranova <email@hidden> wrote:
> I guess I should have been more explicit and said to, first, verify
> that retainCount > 1 with this type of NSLog().  Then, investigate why
> retainCount > 1.  If it is an autorelease, then "try wrapping the body
> of the loop in an autorelease pool," if that is your chosen solution.
> If there are no autoreleases (or not enough to account for the
> retainCount), then you must "find" your missing auto/release to patch
> the real leak.

You assume the object accumulating is one that you can query the
retainCount of. It could be something created by the framework in
response to -[NSString initWithContentsOfFile:].

IMHO it seldom a good idea to query and log retain counts in this way
(it can easily mislead) instead use tools like ObjectAlloc and now
Instruments to understand what is taking place.

-Shawn
_______________________________________________

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

  • Follow-Ups:
    • Re: In-loop releasing of objects does not free memory?
      • From: "Shawn Erickson" <email@hidden>
References: 
 >In-loop releasing of objects does not free memory? (From: Arthur C. <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: John Terranova <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: John Stiles <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: John Terranova <email@hidden>)

  • Prev by Date: Re: [Q] NSXMLDocument & TidyHTML on Leopard
  • Next by Date: Re: Adding obj-c++ file to carbon project changes preprocessed header file types
  • Previous by thread: Re: In-loop releasing of objects does not free memory?
  • Next by thread: Re: In-loop releasing of objects does not free memory?
  • Index(es):
    • Date
    • Thread