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 Alex Bereznyi <al...@grandcentral.com> on 2000/10/04 01:46:33 UTC

xerces-c_1_2D.dll memory leaks

I've run a common XML DOM parsing routine, like: 

{
	DOMParser *parser = 0;
	ErrorHandler *errReporter = 0;
      // Initialize the Xerces system
      XMLPlatformUtils::Initialize();

	parser = new DOMParser;
	errReporter = new DOMTreeErrorReporter();
      parser->setErrorHandler(errReporter);
	parser->setIncludeIgnorableWhitespace(false);

      parser->parse(xmlText);

	// read/use some DOM nodes from DOM tree ...

	XMLPlatformUtils::Terminate();
}

through BoundsChecker 6.5 tool and found that there was lot of memory blocks
leaked (parsing a single 3Kb XML doc this way resulted in about 60Kb of
leaks), much of them are some memory pools used by Xerces-c.

All these leaks are easy to locate (thanks to BoundsChecker) and fix - is
there anybody who could look into this?

My BoundsChecker log file is about 70Kb, but it doesn't seem to save in
plain text, like Purify could.

Let me know if I can help here.
 

Thanks, Alex

Re: xerces-c_1_2D.dll memory leaks

Posted by Dean Roddey <dr...@charmedquark.com>.
Those are all likely to be lazily evaluated static data. This has been much
discussed, search the archives if you want some light hearted reading. But
basically, its working as designed. The only difference between doing it
this way and declaring actual statics, is that its safer this way but the
memory comes from the heap so you see it as a leak, which its really not.

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"It takes two buttocks to make friction"
    - African Proverb


----- Original Message -----
From: "Alex Bereznyi" <al...@grandcentral.com>
To: <xe...@xml.apache.org>
Cc: "Bobby Beckmann" <bo...@12.com>
Sent: Tuesday, October 03, 2000 4:46 PM
Subject: xerces-c_1_2D.dll memory leaks


>
> I've run a common XML DOM parsing routine, like:
>
> {
> DOMParser *parser = 0;
> ErrorHandler *errReporter = 0;
>       // Initialize the Xerces system
>       XMLPlatformUtils::Initialize();
>
> parser = new DOMParser;
> errReporter = new DOMTreeErrorReporter();
>       parser->setErrorHandler(errReporter);
> parser->setIncludeIgnorableWhitespace(false);
>
>       parser->parse(xmlText);
>
> // read/use some DOM nodes from DOM tree ...
>
> XMLPlatformUtils::Terminate();
> }
>
> through BoundsChecker 6.5 tool and found that there was lot of memory
blocks
> leaked (parsing a single 3Kb XML doc this way resulted in about 60Kb of
> leaks), much of them are some memory pools used by Xerces-c.
>
> All these leaks are easy to locate (thanks to BoundsChecker) and fix - is
> there anybody who could look into this?
>
> My BoundsChecker log file is about 70Kb, but it doesn't seem to save in
> plain text, like Purify could.
>
> Let me know if I can help here.
>
>
> Thanks, Alex
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>


RE: xerces-c_1_2D.dll memory leaks

Posted by Joe Pruitt <j....@f5.com>.
Did you do a delete on the parser and errReporter variables?

-Joe

> -----Original Message-----
> From: Alex Bereznyi [mailto:alexber@grandcentral.com]
> Sent: Tuesday, October 03, 2000 4:47 PM
> To: 'xerces-c-dev@xml.apache.org'
> Cc: Bobby Beckmann
> Subject: xerces-c_1_2D.dll memory leaks
> 
> 
> 
> I've run a common XML DOM parsing routine, like: 
> 
> {
> 	DOMParser *parser = 0;
> 	ErrorHandler *errReporter = 0;
>       // Initialize the Xerces system
>       XMLPlatformUtils::Initialize();
> 
> 	parser = new DOMParser;
> 	errReporter = new DOMTreeErrorReporter();
>       parser->setErrorHandler(errReporter);
> 	parser->setIncludeIgnorableWhitespace(false);
> 
>       parser->parse(xmlText);
> 
> 	// read/use some DOM nodes from DOM tree ...
> 
> 	XMLPlatformUtils::Terminate();
> }
> 
> through BoundsChecker 6.5 tool and found that there was lot of memory blocks
> leaked (parsing a single 3Kb XML doc this way resulted in about 60Kb of
> leaks), much of them are some memory pools used by Xerces-c.
> 
> All these leaks are easy to locate (thanks to BoundsChecker) and fix - is
> there anybody who could look into this?
> 
> My BoundsChecker log file is about 70Kb, but it doesn't seem to save in
> plain text, like Purify could.
> 
> Let me know if I can help here.
>  
> 
> Thanks, Alex
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org