Hi Tomaz,

I have been looking in to the memory leaks in the Axis C server
a bit.

I found that in complex objects strings are not deleted. You can
add the delete statments in your setReturnAddPointsParameter
class destructor.

Moreover there is a leak in in Apache1_3module (mod_axis.dll),
in ApacheTransport.cpp where m_pBuffers is not deleted.

I have been requested to do a svn patch but as I am not
working on the lastest version I have not found the time to do
this. I will do it as soon as I can...

/Anders

From: "Tomaz Rotovnik" <[EMAIL PROTECTED]>
Reply-To: "Apache AXIS C User List" <[email protected]>
To: "Apache AXIS C User List" <[email protected]>
Subject: Memory Leak?
Date: Wed, 26 Oct 2005 18:04:26 +0200

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

_________________________________________________________________
Senaste nytt från motormarknaden http://motor.msn.se/

Reply via email to