Hi
 
I'm using axis 1.5 C++. When I tested my client (multithreaded) I found out that memory is growing with number of transactions. I read Axis C++ Memory Management Guide about De-allocation Semantics.
 
For example WSDL2XML generated this parts of code
 
Parameters that will be send over the web
 
 m_pCall->addParameter((void*)&Value0, "lTerminalID", XSD_LONG);
 m_pCall->addParameter((void*)Value1, "sMSISDN", XSD_STRING);
 m_pCall->addParameter((void*)&Value2, "dAmount", XSD_DOUBLE);
 
We expect next received parameters:
 
xsd__string sBlpType;
xsd__double dAmount;
xsd__string lTransactionID;
Where and How can I delete memory for this parameters?
 
Return function is something like that
 
MPBLPSoap::AddPoints(xsd__long Value0, xsd__string Value1, xsd__double Value2){
...
pReturn = (setReturnAddPointsParameter*)m_pCall->getCmplxObject((void*) Axis_DeSerialize_setReturnAddPointsParameter, (void*) Axis_Create_setReturnAddPointsParameter, (void*) Axis_Delete_setReturnAddPointsParameter,"AddPointsResult", 0);
...
}
 
and this is part of calling statement:
 
setReturnAddPointsParameter* pRAPP = NULL;
MPBLPSoap pBLP_authorize(sMPG.strURL.c_str(), APTHTTP1_1);
pBLP_authorize.Timeout(sMPG.iHTTPTimeoutSec);
pRAPP = pBLP_authorize.AddPoints(1,sTr.szMSISDN,sTr.dAmount);
 
After successful operation I call
 
free(pRAPP)
 
but unfortunately I still get memory leak. I checked with Trial version of IBM PurifyPlus and it suspects that memory leak exists because of unallocated parameters :
 
m_pCall->addParameter((void*)Value1, "sMSISDN", XSD_STRING);
 
xsd__string sBlpType;
xsd__double dAmount;
xsd__string lTransactionID;

I also checked what calling free do: It erases the pointers (they become undefined), so they are de-allocated right?
 
But memory is still growing with each transaction and Purify always shows on the same problem.  

I also find out that new char is created when calling
m_pCall->addParameter((void*)Value1, "sMSISDN", XSD_STRING);
so when is this array deleted?
 
Any suggestions are welcome.
 
Tomaz
 

Reply via email to