You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Rob Snell <ro...@ist.co.uk> on 2001/04/12 16:32:37 UTC

memory use / DOM

Hi

My C++ app uses the DOM parser to read in a large number of documents
one after the other for processing. I'm trying to be very careful about
memory usage as the app needs to be reliable and long-running. But despite
my efforts, the memory footprint of the app grows by a few K  each
time a document is read in. 

Environment: 
Win2k
Xerces-1.4.0

In the archives, discussion on this topic has suggested things like

-deleting any strings constructed using transcode()

-not keeping any unecessary internal references to Xerces DOM objects
 otherwise reference counting will keep the objects in memory

-using XMLPlatformUtils::Terminate() at the end.

I'm doing all these things and also calling parser->reset() between each
document read.  I also make copies of transcod()ed data
in to local STL string variables, but those fall out of scope quickly
and should not cause memory leaks.

Are there any other Xerces tricks to avoiding these seemingly unavoidable
memory leaks?  

Thanks,

	Rob


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org