The following comment has been added to this issue:

     Author: PeiYong Zhang
    Created: Fri, 17 Sep 2004 8:38 AM
       Body:
Hi,

    Here is the steps you may give a try.

   1. Upgrade to XercesC2_5_0 and see if it still leaks.

   2. Does a memory tool identify the memory leakage, or you observe      
      the memory growth?

   3. If it is the memory tool, which point it says the leakage 
      happen (besides the allocation of the memory)?

   4. Modify the function
      std::string GetXmlStringNew(DOMNode *pNode) 
      {
         std::string sXML="";
         //don't call DOMWriter
         return sXML;
      }
      then see if it leaks.

    5. Assuming you are using the DOMBuilder to parse your document 
      and get the pNode, you may need call resetDocumentPool() to 
      clear the memory allocated.

Rgds,
PeiYong




---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/XERCESC-1273?page=comments#action_53171

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCESC-1273

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCESC-1273
    Summary: Memory leak with writeToString in DOMWriter..Urgent Plz
       Type: Bug

     Status: Unassigned
   Priority: Critical

    Project: Xerces-C++
   Versions:
             2.4.0

   Assignee: 
   Reporter: Dee

    Created: Fri, 17 Sep 2004 1:48 AM
    Updated: Fri, 17 Sep 2004 8:38 AM

Description:
Hi All,
I have a very critical issue and we a re trying to implement this in our mission 
critical application..
I'm trying to use writeToString in DOMWriter using the function GetXmlString below 
---->
I am getting a memory leak proportionate to the size of document been serialized.
I'm unable to free up the memory allocated .

Is it something else we need to do ensure that the leak is closed..

Kindly suggest..


std::string GetXmlString(DOMNode *pNode)
{
        std::string sXML = "";

        try 
        {
                DOMImplementation* impl =  
DOMImplementationRegistry::getDOMImplementation(X("Core"));
                
                // get the XML string out of the DOM
                DOMWriter  *theSerializer = impl->createDOMWriter();
                XMLCh *xXml = theSerializer->writeToString(*pNode);
                char *pChar = XMLString::transcode(xXml);
                sXML = pChar;
                XMLString::release(&pChar);
                
                XMLString::release(&xXml);
        
                delete theSerializer;
        //      delete impl;
//                      theSerializer->release();
                //delete theSerializer;
        }
    catch(const XMLException& toCatch)
    {
        char *pMsg = XMLString::transcode(toCatch.getMessage());                

        XMLString::release(&pMsg);
                
    }
        return sXML;
}






---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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

Reply via email to