• 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: nodeForXPath leaks memory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nodeForXPath leaks memory


  • Subject: Re: nodeForXPath leaks memory
  • From: Alastair Houghton <email@hidden>
  • Date: Thu, 22 Nov 2007 10:17:21 +0000

On 22 Nov 2007, at 02:58, Lorenzo Thurman wrote:

I posted this on usenet, but still could not solve the problem. Maybe someone here can help me:

I have a subclass of NSXMLDocument that I use as an XMLParser. While running my program through MallocDebug and Leaks, I see that I am leaking blocks of memory in one of my methods.

Are you sure these represent an actual memory leak? Some code caches objects to avoid the allocation (and sometimes initialisation) overhead, so it may just be that these objects are in some sort of cache and will be re-used when you call -nodesForXPath:error: again.


The way to check is to see whether repeatedly calling your - itemsForElement: method results in more and more XQuery blocks showing up in the list. If it doesn't, they're probably in a cache.

(These types of caches often don't get explicitly released, which is why they tend to show up as leaks when you're using leak-detection tools.)

Kind regards,

Alastair.

--
http://alastairs-place.net


_______________________________________________

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: 
 >nodeForXPath leaks memory (From: Lorenzo Thurman <email@hidden>)

  • Prev by Date: Re: XCode 3 Debugger bug?
  • Next by Date: Re: nodeForXPath leaks memory
  • Previous by thread: nodeForXPath leaks memory
  • Next by thread: Re: nodeForXPath leaks memory
  • Index(es):
    • Date
    • Thread