Dear David Bertoni, The reason why I think Xerces is leaking is - I can see memory allocation at the time when " m_domParser->parse(*membuf);" function is called and this memory is never released. The size of the process increases by the amount of memory allocated at this point.
As my process never terminates and keeps on running all the time i.e. taking request-processing-giving the response, so earlier it was assumed that it is normal C runtime heap allocation (and caching) but then it was found that the process size is increasing everyday. At the time of start of process the size is 61Mb but it has grown to 1.5Gb which made restart of process inevitable. Please note that the memory is not leaking every time this piece of code is called. Also the pattern of leak is also not fixed. Sometimes the allocation on heap is 16Kb and sometimes it is 128Kb and sometimes there is no memory leak. Also please note that there is no loop on this code. This is called when our process receives a request to process and XML. For each request we are creating a new object of XercesDOMParser with 'new' and after the required XML is processed we are deleting the object there by releasing the memory. Please suggest if I am forgetting to call any release function or any other function which will release the memory. Thanks, Abhinav Kishore -----Original Message----- From: David Bertoni [mailto:[email protected]] Sent: Monday, June 15, 2009 10:44 PM To: [email protected] Subject: Re: Regd issue : Memory leak in 'Parse' function of DOMParser Abhinav Kishore Srivastava wrote: > Hi, > > There is a memory leak in the parse function of XercesDOMParser. Please > find below the details: > > OS used: Solaris 10 > Xerces version: 2.8.0 > Software used: Rogue wave libraries for string functions. > > *_Code Snippet which leaks:_* > ... > > *m_domParser->parse(*membuf); //memory > utilization increases here and later on when delete m_domParser is > called, it is not released.* Are you sure that Xerces-C is leaking? It's common for the C run-time heap implementation to keep memory that you've freed cached for future allocations. What happens when you run this code in a loop for a thousand interations or so? Does memory usage keep increasing, or does it remain stable? Dave --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] **************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
