Hi and thanks four your answer.
The ElementXML is a class from scratch that only contains a pointer to a
DOMNode element. It's only here to redefine some methods to access the
Elements inside a DOMNode.
Didn't knew about valgring. I compile on AIX so I'll give it a try.

The weirdest thing happened : my program is a short of demon. It runs
"forever" and treats the files I put in a folder (to sum up). When I give it
3000 files, I get a core dump with the memory growing up to 120 Mo not
released.
If I use 300 files, the memory goes up to 35 Mo. If I put 600 files, it
grows to 55 Mo. But, if I put 300 files, let the program roll and put again
300 files, I see the memory growing up to 35 Mo the first time, and when I
put the next 300, the memory is still at 35 Mo, but it doesn't grow anymore.
nos, if I place 300 files, and then 600, the memory grows up for the first
300, then stays still for the next 300 and then starts growing again for the
last 300. 

It acts like when it processes files continuously, it can't free the memory.
But if I "let it breath" and give it some more files, the memory is somehow
"reused" for the same amount of memory...

Does anybody have any idea where this behavior can come from??
Thanks.


David Bertoni wrote:
> 
> radada wrote:
>> Hi there
>> 
>> 
>> after searching a little bit, I found that there was some objects that
>> were
>> not deleted in the other programs.
>> But (still that damn but...) I still get a memory leak. Weird thing :
>> when I
>> delete the parser, the memory doesn't decrease. It just stays still...
>> And
>> after a couple hundreds of XML files parsed, this memory leak is getting
>> big.
>> It seems that the memory increases after calling the parse method. But
>> since
>> the deletion of the parser seems to have no effect on the memory, it
>> could
>> come from either methods.
>> 
>> Here's the code for the parse method : 
>> 
>> ElementXML* ParserXML::parse(const char* p_pcBuffer)
>> {
>>    #ifdef AFF
>>       cout << "ParserXML::parse()" << endl;
>>    #endif
>>       
>>    // Si aucun buffer n'est passé, on renvoie NULL
>>    if (p_pcBuffer == NULL)
>>    {
>>       #ifdef DEBUG
>>          cout << "Aucun Flux à Parser!!!" << endl;
>>       #endif
>>       return NULL;
>>    }
>>    
>>    char* l_pcMessage;
>>    // on crée un objet pour le parsing
>>    MemBufInputSource l_oInputSource((const XMLByte*)p_pcBuffer,
>>                                     strlen(p_pcBuffer),
>>                                     (const XMLCh*)  "ParserXML");
> You cannot cast a character string constant to a UTF-16 string.  This 
> cast is incorrect.
> 
>>    try
>>    {
>>       // on parse
>>       m_poDOMParser->parse(l_oInputSource);
>>       #ifdef DEBUG
>>          cout << "Document Parsé" << endl;
>>       #endif
>>       
>>       // on libère la mémoire si besoin
>>       delete(m_poElementXML);
>>       //on crée un nouveau ElementXML avec les données du DOMDocument
>>       m_poElementXML = new
>> ElementXML(m_poDOMParser->getDocument()->getDocumentElement());
>>       // on retourne l'ElementXML ainsi créé
>>       return m_poElementXML;
> Is ElementXML a single class, or a hierarchy of clases?  What does its 
> definition look like?
> 
> If you are building on Linux, I suggest you run your program under 
> valgrind, which will detect errors and memory leaks in your program.
> 
> If you are building on Windows, I suggest you turn on the leak detection 
> code in the C run-time library, which will give you a dump of leaks when 
> your program exits.
> 
> Dave
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Core-Dump-while-releasing-Parser-ressources...-tp23560721p23761914.html
Sent from the Xerces - C - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to