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 Arun Ramdas <ar...@etrade.com> on 2002/04/04 22:27:06 UTC

Memory leak in parsing -- repost

Sorry for the repost! I desperately need ur help!

I have a tuxedo server, which creates DOM Parser globally in the memory. As
and when the request comes in, the xml is parsed using this available
parser, and this variable is deleted when the server is shutdown.


I am purifying my code using "purify" and after 3-4 requests,
i am seeing severe leak in the parsing stage. let me attach the code piece.

bool hasErrors = false;
  try {
  SA_Parser->parse(*memBufIS);  //MEMORY LEAK
  }
  catch(const XMLException& e)
  {
     DOMString dom_str = DOMString(e.getMessage());
     char *str_val = dom_str.transcode();
 
lm_message(LM_VERBOSE,GetProgramName(),SVC_PARSE_ERROR,"SA_ParseXmlMessage",
-1," %d Er
ror during Message Parsing: %s ",
                __LINE__ , str_val);
     free(str_val);
     hasErrors = true;

  }
  catch(...)
  {
    hasErrors = true;
  }
  if(!hasErrors)
  {
    DOM_Document doc = SA_Parser->getDocument();
    ret_doc = doc;
  }
  else
  {
    *response = SAFaultError(SVC_PARSE_ERROR, "NONE", FaultActor);
    DOM_Document errDoc;
    ret_doc = errDoc;
  }

I am also attaching the purify window snapshot... sorry for the message
size.( i thought i need to be descriptive)

 <<...OLE_Obj...>> 

Thanks
Arun



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Memory leak in parsing -- repost

Posted by Tinny Ng <tn...@ca.ibm.com>.
Don't see anything obvious here.  Just a general question first, which
version of Xerces-C++ are you using?  Please try the latest version 1.7 or
even better the latest nightly build and see if leak persists.  BTW please
also make sure your code has deleted all the transcoded string.

> I am also attaching the purify window snapshot... sorry for the message
> size.( i thought i need to be descriptive)
>
>  <<...OLE_Obj...>>

It's good idea to post the report snapshot for further investigation.   But
I couldn't see such attachment here.....

Thanks!

Tinny


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org