Thanks Alberto.I will check this up!
does a release have to be called on the DOMDocument pointer as many
times as a CreateDocument and a getDocumentElement is done ?

-----Original Message-----
From: Alberto Massari [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 03, 2006 1:46 PM
To: [email protected]
Subject: RE: [jira] Commented: (XERCESC-1279) Memory leak with
writeToString in DOMWriter

Hi Pranav,

At 13.10 03/11/2006 +0530, Pranav, Savkur wrote:
>Hello Alberto,
>         Thanks. I was able to get over the release problem as well!
>Sometimes, the transcode of XMLString crashes the application:
>I have the code as below:
>
>XERCES_CPP_NAMESPACE::XMLString::transcode("LS", tempStr, 99);
>
>This is foll.by:
>XERCES_CPP_NAMESPACE::DOMImplementation *impl          =
>XERCES_CPP_NAMESPACE::DOMImplementationRegistry::getDOMImplementation(t
>e
>mpStr);
>pSerializer =
>((XERCES_CPP_NAMESPACE::DOMImplementationLS*)impl)->createDOMWriter();
>
>All of this is surrounded by a try-catch block.But soon after the 
>XMLString::transcode, a generic exception is caught!
>This was an intermittent behavior but is happening regularly now.
>
>Is this a known problem?

No, this shouldn't happen. Are you sure you have called
XMLPlatformUtils::Initialize and haven't called
XMLPlatformUtils::Terminate yet?

Alberto


>thanks,
>Pranav
>
>-----Original Message-----
>From: Alberto Massari [mailto:[EMAIL PROTECTED]
>Sent: Thursday, November 02, 2006 3:30 PM
>To: [email protected]
>Subject: RE: [jira] Commented: (XERCESC-1279) Memory leak with 
>writeToString in DOMWriter
>
>At 14.41 02/11/2006 +0530, Pranav, Savkur wrote:
> >Hello Alberto,
> >         thanks for the confirmation!
> >Does this hold even for releasing memory held by DOMDocument and 
> >XercesDOMParser pointers as well.
> >         Also if a release/delete is called on the XercesDOMParser 
> >pointer,is it necessary to call release/delete on the DOMDocument 
> >pointer got from the parser pointer using a getDocument?
>
>Hi Pranav,
>if you used getDocument() to get the DOMDocument pointer, memory is 
>automatically released when you release the parser. If you used 
>adoptDocument(), you have to release both the parser and the 
>DOMDocument.
>Remember that "release the parser" could mean calling "delete" (if you 
>created with a "new XercesDOMParser") or calling "parser->release()" 
>(if you created it by using domImpl->createDOMBuilder() ).
>
>Hope this helps,
>Alberto
>
>
> >Thanks,
> >Pranav
> >
> >
> >-----Original Message-----
> >From: Alberto Massari (JIRA) [mailto:[EMAIL PROTECTED]
> >Sent: Thursday, November 02, 2006 1:52 PM
> >To: [email protected]
> >Subject: [jira] Commented: (XERCESC-1279) Memory leak with 
> >writeToString in DOMWriter
> >
> >     [
> >http://issues.apache.org/jira/browse/XERCESC-1279?page=comments#actio
> >n_
> >1
> >2446501 ]
> >
> >Alberto Massari commented on XERCESC-1279:
> >------------------------------------------
> >
> >Yes, you should call release() instead of delete, in order to be sure

> >to use the proper memory manager
> >
> > > Memory leak with writeToString in DOMWriter
> > > -------------------------------------------
> > >
> > >                 Key: XERCESC-1279
> > >                 URL:
>http://issues.apache.org/jira/browse/XERCESC-1279
> > >             Project: Xerces-C++
> > >          Issue Type: Bug
> > >    Affects Versions: 2.5.0
> > >            Reporter: Dee
> > >            Priority: Critical
> > >         Attachments: xerces_leak.JPG
> > >
> > >
> > > 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
> >-
> >For more information on JIRA, see:
> >http://www.atlassian.com/software/jira
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >The new company Nokia Siemens Networks is expected to start 
> >operations by January 1, 2007, subject to customary regulatory 
> >approvals, the completion of standard closing conditions, and the 
> >agreement of a number of detailed implementation steps.
> >
> >Disclaimer:
> >This e-mail may contain trade secrets or privileged, undisclosed or 
> >otherwise confidential information. If you have received this e-mail 
> >in
>
> >error, you are hereby notified that any review, copying or 
> >distribution
>
> >of it is strictly prohibited. Please inform us immediately and 
> >destroy the original transmittal. Thank you for your cooperation.
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>The new company Nokia Siemens Networks is expected to start operations 
>by January 1, 2007, subject to customary regulatory approvals, the 
>completion of standard closing conditions, and the agreement of a 
>number of detailed implementation steps.
>
>Disclaimer:
>This e-mail may contain trade secrets or privileged, undisclosed or 
>otherwise confidential information. If you have received this e-mail in

>error, you are hereby notified that any review, copying or distribution

>of it is strictly prohibited. Please inform us immediately and destroy 
>the original transmittal. Thank you for your cooperation.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


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



The new company Nokia Siemens Networks is expected to start operations by 
January 1, 2007, subject to customary regulatory approvals, the completion of 
standard closing conditions, and the agreement of a number of detailed 
implementation steps.

Disclaimer:
This e-mail may contain trade secrets or privileged, undisclosed or otherwise 
confidential information. If you have received this e-mail in error, you are 
hereby notified that any review, copying or distribution of it is strictly 
prohibited. Please inform us immediately and destroy the original transmittal. 
Thank you for your cooperation.

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

Reply via email to