This looks like a bug in XercesParserLiaison. Try modifying your code as
follows, to see if that clears up the problem:
while (1) {
process (doc, theParserLiaison, theDOMSupport);
theParserLiaison.reset();
}
Dave
Dmitry Hayes
<[EMAIL PROTECTED] To: [EMAIL PROTECTED]
com> cc: (bcc: David N
Bertoni/Cambridge/IBM)
Subject: Re:
XercesDOMWrapperParsedSource memory problem
08/06/2003 08:20
AM
Please respond
to xalan-dev
It's sounds like a problem.
Can you please verify if it's a real memory leak and create a bug report in
the bugzilla ?
Thanks
Dmitry
Vladimir Marek
<[EMAIL PROTECTED] To:
[EMAIL PROTECTED]
cz> cc:
Subject: Re:
XercesDOMWrapperParsedSource memory problem
06/08/2003 09:16
AM
Please respond to
xalan-dev
Hello Dmitry,
I'm afraid that XMLPlatformUtils::Terminate() can be called only once,
at the end of the program. My problem is that I would like to process
many (thousands) xml files in one program run by one stylesheet, and
that would need to free the memory more often. I was probably unclear in
my question, I'm sorry.
Vladimir
> Hello Vladimir!
> Try to call
>
> XMLPlatformUtils::Terminate();
>
> in the end of your program
> Dmitry
>
>
>
>
> Vladimir Marek
> <[EMAIL PROTECTED] To:
[EMAIL PROTECTED]
> cz> cc:
> Subject:
XercesDOMWrapperParsedSource memory problem
> 06/08/2003 05:03
> AM
> Please respond to
> xalan-dev
>
>
>
>
>
>
> Hello,
>
> I found that my program is leaking, and after some investigation I found
> this minimal testcase:
>
> -- CUT --
> using namespace std;
>
> #include <iostream>
>
> #include <xercesc/util/PlatformUtils.hpp>
> #include <xercesc/dom/DOM.hpp>
>
> #include <XercesParserLiaison/XercesDOMSupport.hpp>
> #include <XercesParserLiaison/XercesParserLiaison.hpp>
> #include <XalanTransformer/XercesDOMWrapperParsedSource.hpp>
>
> XALAN_CPP_NAMESPACE_USE
> XERCES_CPP_NAMESPACE_USE
>
> void process(
> DOMDocument *input,
> XercesParserLiaison &theParserLiaison,
> XercesDOMSupport &theDOMSupport)
> {
>
> XercesDOMWrapperParsedSource parsedSource
> (input, theParserLiaison, theDOMSupport);
>
> }
>
> int main (int argc, char **argv) {
> XMLPlatformUtils::Initialize();
>
> DOMImplementation* impl =
> DOMImplementationRegistry::getDOMImplementation
> (XMLString::transcode("Core"));
>
> DOMDocument* doc =
> impl->createDocument( 0, XMLString::transcode("root"),
> 0);
>
> XercesDOMSupport theDOMSupport;
> XercesParserLiaison theParserLiaison;
>
> while (1) {
> process (doc, theParserLiaison, theDOMSupport);
> }
>
> return 0;
> }
> -- CUT --
>
> Problem is in the function 'process', each construction of
> XercesDOMWrapperParsedSource takes some memory, but it's never freed.
> Probably I'm missing something, please could you help me a bit ?
>
> PS: I'm not sure if I am at the correct list, if not, would you be so
> kind and redirect me ?
>
> Thank you
> --
> Vladim�r Marek