FROM : Alastair Houghton
DATE : Thu Nov 22 11:17:21 2007
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
DATE : Thu Nov 22 11:17:21 2007
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
| Related mails | Author | Date |
|---|---|---|
| Lorenzo Thurman | Nov 22, 03:58 | |
| Alastair Houghton | Nov 22, 11:17 | |
| Alastair Houghton | Nov 22, 11:19 | |
| Lorenzo Thurman | Nov 23, 07:39 |






Cocoa mail archive

