xerces-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kosaraju Karuna-C9013Z" <C90...@motorola.com>
Subject MemoryLeaks in Xerces
Date Mon, 29 Jan 2007 21:43:23 GMT
Hi,
 
We have designed a tool to read the XML file using SAX Parser.
Our tool has two interface APIs, initialize() and terminate().
In the Initialize method, we do invoke
 
-XMLPlatformUtils::Initialize(); followed by, 
 
pParser=XMLReaderFactory::createXMLReader();
pParser->setFeature(XMLUni::fgSAX2CoreValidation, false);
pParser->setFeature(XMLUni::fgXercesDynamic, false);
pParser->setFeature(XMLUni::fgXercesSchema, false);
pParser->setFeature(XMLUni::fgXercesSchemaFullChecking,false);
pParser->setContentHandler(this);
pParser->setErrorHandler(this);
 
pParser->parse(pXmlFile);
 
And in the terminate API call, we do invoke
 
XMLPlatformUtils::terminate()
 
When we just invoke initialize and terminate, we do see some memory
leaks. The purify shows somethindg as below
 
PLK: 9856 bytes potentially leaked in 176 blocks
  * This memory was allocated from:
 malloc         [rtlib.o]
 operator new(unsigned) [libstdc++.so.5]
 operator new(unsigned) []
 xercesc_2_6::MemoryManagerImpl::allocate(unsigned)
[MemoryManagerImpl.cpp:46]
 xercesc_2_6::XMemory::operator new(unsigned,
xercesc_2_6::MemoryManager*) [XMemory.cpp:66]
 xercesc_2_6::IGXMLScanner::scanStartTagNS(bool&)
[IGXMLScanner.cpp:2367]
  * Block of 56 bytes (176 times); last block at 0x816dbe0
 
PLK: 9448 bytes potentially leaked in 2 blocks
  * This memory was allocated from:
 malloc         [rtlib.o]
 operator new(unsigned) [libstdc++.so.5]
 operator new(unsigned) []
 std::__default_alloc_template<true, 0 >::_S_chunk_alloc(unsigned, int&)
[libstdc++.so.5]
 std::__default_alloc_template<true, 0 >::_S_refill(unsigned)
[libstdc++.so.5]
 std::__default_alloc_template<true, 0 >::allocate(unsigned)
[libstdc++.so.5]
  * Block of 4776 bytes at 0x80c1300
  * Block of 4672 bytes at 0x80bf6b8
 
Where could be the possible leak? We are using xerces 2.6.Are we
supposed to invoke any other API apart from
XMLPlatformUtils::terminate()??
Pls let us know. Thanks in advance. 
 
Regards
Karuna

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message