Re: nodeForXPath leaks memory
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