You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by xe...@xml.apache.org on 2004/09/30 08:30:31 UTC

[jira] Created: (XERCESC-1279) Memory leak with writeToString in DOMWriter

Message:

  A new issue has been created in JIRA.

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

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

     Status: Unassigned
   Priority: Critical

    Project: Xerces-C++
   Versions:
             2.5.0

   Assignee: 
   Reporter: Dee

    Created: Wed, 29 Sep 2004 11:29 PM
    Updated: Wed, 29 Sep 2004 11:29 PM

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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Commented: (XERCESC-1279) Memory leak with writeToString in DOMWriter

Posted by xe...@xml.apache.org.
The following comment has been added to this issue:

     Author: Dee
    Created: Wed, 29 Sep 2004 11:30 PM
       Body:
Hi, 
i also tried using this snippet ..but the memory leak is still there.. 

std::string GetXmlStringNew(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 tempStr[100]; 
     
MemBufFormatTarget destination; 
bool retVal; 

try 
{ 
retVal = theSerializer->writeNode(&destination, *pNode); 
} 
catch (...) 
{ 
retVal = false; 
} 

//const 
char *charString = (retVal ? XMLString::replicate((char*)destination.getRawBuffer()) : 0); 

//delete theSerializer; 
theSerializer->release(); 

//****************************** 
// std::string sRet(charString); 
sXML = charString; 
XMLString::release(&charString); 
return sXML; 

} 
    catch(const XMLException& toCatch) 
    { 
        char *pMsg = XMLString::transcode(toCatch.getMessage()); 

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

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

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

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

     Status: Unassigned
   Priority: Critical

    Project: Xerces-C++
   Versions:
             2.5.0

   Assignee: 
   Reporter: Dee

    Created: Wed, 29 Sep 2004 11:29 PM
    Updated: Wed, 29 Sep 2004 11:30 PM

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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Commented: (XERCESC-1279) Memory leak with writeToString in DOMWriter

Posted by "cargilld (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESC-1279?page=comments#action_57422 ]
     
cargilld commented on XERCESC-1279:
-----------------------------------

Were you able to reproduce with DOMCount?  If not lets close this bug.

> Memory leak with writeToString in DOMWriter
> -------------------------------------------
>
>          Key: XERCESC-1279
>          URL: http://issues.apache.org/jira/browse/XERCESC-1279
>      Project: Xerces-C++
>         Type: Bug
>     Versions: 2.5.0
>     Reporter: Dee
>     Priority: Critical

>
> 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; 
> } 

-- 
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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Commented: (XERCESC-1279) Memory leak with writeToString in DOMWriter

Posted by xe...@xml.apache.org.
The following comment has been added to this issue:

     Author: PeiYong Zhang
    Created: Thu, 30 Sep 2004 8:51 AM
       Body:
Dee,

  To isolate the leakage problem, I've done test on the sample, DOMPrint and there is no leakage reported from Purify.

   You may start from DOMPrint as well, by changing line#494

        //
        // do the serialization through DOMWriter::writeNode();
        //
        //theSerializer->writeNode(myFormTarget, *doc);

        XMLCh* strResult = theSerializer->writeToString(*doc);
        XMLString::release(&strResult);

    by commenting/uncommenting the release the purify will report leakage/no leakage.

   Besides, can you post the leakage report from your memeor tool? thanks.

Rgds,
PeiYong

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

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

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

     Status: Unassigned
   Priority: Critical

    Project: Xerces-C++
   Versions:
             2.5.0

   Assignee: 
   Reporter: Dee

    Created: Wed, 29 Sep 2004 11:29 PM
    Updated: Thu, 30 Sep 2004 8:51 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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Resolved: (XERCESC-1279) Memory leak with writeToString in DOMWriter

Posted by "cargilld (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESC-1279?page=history ]
     
cargilld resolved XERCESC-1279:
-------------------------------

    Resolution: Cannot Reproduce

I am closing this bug due to lack of response. Feel free to add a comment requesting it be reopened if this is still an issue.

> Memory leak with writeToString in DOMWriter
> -------------------------------------------
>
>          Key: XERCESC-1279
>          URL: http://issues.apache.org/jira/browse/XERCESC-1279
>      Project: Xerces-C++
>         Type: Bug
>     Versions: 2.5.0
>     Reporter: Dee
>     Priority: Critical

>
> 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; 
> } 

-- 
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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org