Dear Jason,

On 22 Dec 2003, Jason E. Stewart wrote:

> > Will this issue be fixed in the next release?
> 
> Sure, I'll add the fix. 

Thank you very much!

> Did the change affect the torrential memory leaks
> that XML-Xerces has? 

No. I turned on valgrind's --leak-check=yes and it reports no memory leak
due to XMLString2Perl(). In fact, the memory is freed within the function
(line 1015 of Xerces.cpp). This change does not affect the memory leak due
to Xerces's parsing -- the leak exist before and after the change.

> Has valgrind identified any other sources where
> the memorly leaks can be coming from? It is *ultra-critical* to get
> those fixed as soon as possible.

Yes. I used the script "mleak5.pl"

----------------------------------
#!/usr/bin/perl -w

use XML::Xerces;

my $impl = 
XML::Xerces::DOMImplementationRegistry::getDOMImplementation('LS');

my $parser =
$impl->createDOMBuilder($XML::Xerces::DOMImplementationLS::MODE_SYNCHRONOUS,'');

$parser->setFeature("$XML::Xerces::XMLUni::fgDOMNamespaces", 1);
$parser->setFeature("$XML::Xerces::XMLUni::fgXercesSchema", 0);
$parser->setFeature("$XML::Xerces::XMLUni::fgXercesSchemaFullChecking",
        0) ;

$parser->setFeature("$XML::Xerces::XMLUni::fgDOMValidation", 0);

my $doc = $parser->parseURI("example.xml") ;

$parser->resetDocumentPool();
------------------------------------

And use valgrind to check:

$ valgrind --leak-check=yes --num-callers=100 perl ./mleak5.pl

One error message relavant to Xerces-C/Perl's memory leak is:

==28213== 6480 bytes in 236 blocks are possibly lost in loss record 22 of 
30
==28213==    at 0x40026164: __builtin_new (in 
/usr/lib/valgrind/vgskin_memcheck.so)
==28213==    by 0x400261BC: operator new(unsigned) (in 
/usr/lib/valgrind/vgskin_memcheck.so)
==28213==    by 0x43A2930E: 
xercesc_2_3::MemoryManagerImpl::allocate(unsigned) 
(MemoryManagerImpl.cpp:75)
==28213==    by 0x43A9C37F: xercesc_2_3::XMemory::operator new(unsigned) 
(XMemory.cpp:77)
==28213==    by 0x439FC2DF: xercesc_2_3::DTDGrammar::resetEntityDeclPool() 
(DTDGrammar.cpp:217)
==28213==    by 0x439FC2A4: xercesc_2_3::DTDGrammar::reset() 
(DTDGrammar.cpp:201)
==28213==    by 0x439FBF22: 
xercesc_2_3::DTDGrammar::DTDGrammar(xercesc_2_3::MemoryManager*) 
(DTDGrammar.cpp:128)
==28213==    by 0x43A19AEE: 
xercesc_2_3::IGXMLScanner::scanReset(xercesc_2_3::InputSource const&) 
(IGXMLScanner2.cpp:867)
==28213==    by 0x43A1E7DB: 
xercesc_2_3::IGXMLScanner::scanDocument(xercesc_2_3::InputSource const&) 
(IGXMLScanner.cpp:190)
==28213==    by 0x43AAB581: xercesc_2_3::XMLScanner::scanDocument(unsigned 
short const*) (XMLScanner.cpp:419)
==28213==    by 0x43983508: xercesc_2_3::AbstractDOMParser::parse(unsigned 
short const*) (AbstractDOMParser.cpp:457)
==28213==    by 0x439C3F15: xercesc_2_3::DOMBuilderImpl::parseURI(unsigned 
short const*) (DOMBuilderImpl.cpp:447)
==28213==    by 0x43119080: _wrap_DOMBuilder_parseURI__SWIG_0 
(Xerces.cpp:62581)
==28213==    by 0x4311A0CC: _wrap_DOMBuilder_parseURI (Xerces.cpp:62679)
==28213==    by 0x402ACCD5: Perl_pp_entersub (in 
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so)
==28213==    by 0x402A62E8: Perl_runops_standard (in 
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so)
==28213==    by 0x40240D2A: (within 
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so)
==28213==    by 0x40240AC4: perl_run (in 
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so)
==28213==    by 0x8049182: main (in /usr/bin/perl5.8.0)
==28213==    by 0x403C7159: __libc_start_main (in /lib/libc-2.2.5.so)
==28213==    by 0x8049010: (within /usr/bin/perl5.8.0)

Hope this help.


-- 
Best Regards,

Chris Cheung
Center for Large-Scale Computation

Have a nice day!




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to