|
Hi Anders
I checked the method Axis_Delete_setReturnAddPointsParameter and it deletes all the structure,
but it is never called, so I put statement calling this method after I perform
transaction. Anyway memory leak still exists. So it is really strange. I think
I'll go to check how many times is "new" operator called when deserializing
individual parameter.
pRAPP =
pBLP_authorize.AddPoints(1,sTr.szMSISDN,sTr.dAmount);
//data processing Axis_Delete_setReturnAddPointsParameter(pRAPP);
void
Axis_Delete_setReturnAddPointsParameter(setReturnAddPointsParameter* param, bool
bArray = false, int nSize=0){ if (bArray) delete [] param; else delete param; } Best regards
Tomaz
>
> The correct way to destroy complex objects is probably to use > the static function Axis_Delete_setReturnAddPointsParameter(...) > which you can find in setReturnAddPointsParameter.cpp. > > I haven't been looking at XSD_DOUBLE etc but if you say that > these are created with new you are probably correct. > > /Anders > >>From: Tomaz Rotovnik <[EMAIL PROTECTED]> >>Reply-To: "Apache AXIS C User List" <[email protected]> >>To: Apache AXIS C User List >><[email protected]>,[EMAIL PROTECTED] >>Subject: Re: Memory Leak? >>Date: Thu, 27 Oct 2005 10:43:57 +0200 >> >>Hi Anders >> >>I'm using Axis C client, but I suppose that the memory leaks are the same >>right? I already tried with putting delete statements into destructor >>classes but they are never called if I use free(pRAPP), where pRAPP is >>setReturnAddPointsParameter*. So should I use delete instead of free? I'm >>a little bit confused, because Management Guide about De-allocation >>Semantics talks about usage of free statements. >> >>In case of deserialazing received parameters from web server I think that >>statement "new" is used also for allocating basic types XSD_DOUBLE or >>XSD_LONG. If is this true then this should be also deleted in destructor, >>right? >> >>Best regards >> >>Tomaz >> >> >>----- Original Message ----- From: "Anders Eriksson" >><[EMAIL PROTECTED]> >>To: <[email protected]> >>Sent: Thursday, October 27, 2005 10:01 AM >>Subject: RE: Memory Leak? >> >> >>> >>>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 |
- Memory Leak? Tomaz Rotovnik
- RE: Memory Leak? Anders Eriksson
- Re: Memory Leak? Tomaz Rotovnik
- Re: Memory Leak? Anders Eriksson
- Re: Re: Memory Leak? Tomaz Rotovnik
