axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ash VI <ashvit...@gmail.com>
Subject Re: How to fix memory leak in Axis2/C client?
Date Mon, 15 Mar 2010 06:23:29 GMT
Hi All,

I have seen the same memory leak problem in my client code implementation.
Though like to know if any workaround and temporary solution for this
instead of waiting 7.0 version.

I am using axis2/c 6.0 with libxml2 parser. I created stub using wsld2c for
JBoss WS and it uses SSL. My application runs fine, but memory grows
on multiple webservice call. I put debugger and perfmon/task manger  to
observe this and clearly seen taht memory is not get released when
application request and response freed.

I see the memory get released whenever application frees the stub/env object
only (axis2_stub_free,axutil_env_free), not when request and response object
freed by using stub created functions (adb_XXXXX_free,
adb_XXXXXResponse_free).

I got blocked as my application needs multiple webservice calls and in
multithreaded environement.

The following solution I can think -
1) Create stub and env object for every web service call or thread and free
it immediately to avoid memory leak. Though this workaround leads problem
(access voilation) in when I use it in multithreaded environment

Ex: thread 1,  creates stub and env , invokes the webservice call and frees
the stub and env object. After that when I create other object whenever
required in other thread and it gives the access violation in
axis2_stub_create_MYWebService(..) at
axis2_stub_create_with_endpoint_ref_and_client_home(...) while creating the
stub. Also sometime, application creates stub object in callback function
(main thread)  which is called from another thread fuction using callback
handler and the same issue is observed.

Note that I have used axis2_options_set_xml_parser_reset() function by
suspecting libxml2 problem, but it did not help me. I have gone through
following posts, but could not resolve memory leak with multilthreaded
application.


Let know if we have any workaround to to resolve this . Any help/pointers
will be greatly appreciated.


Thanks,
Ashok

----
Releated Posts:-

Memory maangement in generated ad...
http://markmail.org/message/mqn4lsloubayyr3k#query:axis-c%20stub%20adb%20not%20freeing%20memory+page:1+mid:qsplc6qeyuggheen+state:results

Multithreading
http://marc.info/?l=axis-c-dev&m=122899239530621&w=2
Multithreaded Again
http://marc.info/?l=axis-c-user&m=118399660218878&w=2
Seg fault in libxml when svc client torn down in a multithreaded client
https://issues.apache.org/jira/browse/AXIS2C-884


 Stack Trace for access violation in multilthreaded application (Release
build):
 ----------------------------------------------------------------------------------------------------

axis2_stub_create_MYWebService(..)
<-->axis2_stub_create_with_endpoint_ref_and_client_home(...)
 ntdll.dll!7c91b21a()
  [Frames below may be incorrect and/or missing, no symbols loaded for
ntdll.dll]
  ntdll.dll!7c9101db()
  msvcrt.dll!77c2c3c9()
  msvcrt.dll!77c2c3ce()
  msvcrt.dll!77c2c3ce()
  msvcrt.dll!77c2c3e7()
  ntdll.dll!7c901046()
  libxml2.dll!0143dc6d()
  libxml2.dll!014024c4()
  libxml2.dll!01456115()
  libxml2.dll!01459720()
  libxml2.dll!0145b87b()
  axis2_engine.dll!1001cd82()
  axis2_engine.dll!10047821()
  axis2_engine.dll!1004c02b()
  axis2_engine.dll!10049fa5()
  axis2_engine.dll!10049faf()
  axis2_engine.dll!10061eb7()
  axis2_engine.dll!10053681()
  axis2_engine.dll!10053b25()
> DaaSAgent.exe!axis2_stub_create_MyWebService(const axutil_env *
env=0x02198270, const char * client_home=0x01dec9d0, const char *
endpoint_uri=0x01def660)  Line 36 + 0x14 bytes C
  DaaSAgent.exe!AxisClientStub::AxisClientStub(const char *
endpointUri=0x01def660, const char * clienthome=0x01dec9d0, const char *
logfile=0x0115ff00)  Line 48 + 0x14 bytes C++




Thanks,
Ashok

On Wed, Mar 10, 2010 at 10:43 PM, George Sherwood <gsherwood@att.net> wrote:

>  Olivier,
> There is a 1.6.0 service using https described at
> http://testcover.com/pub/wsdl_notes.php
> If this is simple enough to meet your need, let me know, and I'll send you
> an activation code so that you can use it.
> George Sherwood
> Testcover.com, LLC
>
>  ----- Original Message -----
> *From:* Olivier Mengué <omengue@oxymel.com>
>  *To:* Apache AXIS C User List <c-user@axis.apache.org> ; Apache AXIS C
> User List <c-user@axis.apache.org>
>  *Sent:* Wednesday, March 10, 2010 11:46 AM
> *Subject:* RE : How to fix memory leak in Axis2/C client?
>
>
>
>
> Samisa Abeysinghe wrote:
>
> >>On Thu, Mar 4, 2010 at 9:51 PM, Hatim Daginawala wrote:
> >>
> >> svc_client is not designed to be reused.
> >>
>
> > This is an incorrect statement. We reuse it, and it can be re-used.
>
> I have not been able to reproduce the leak with a simple HTTP client that
> queries the Mellbourn.com password generator service.
> http://www.service-repository.com/service/wsdl?id=98309
>
> However I have the leak in my HTTPs client. So I suppose that Axis2/C leaks
> OpenSSL objects.
> That's also what Insure++ told me, but I've not been able to to distinguish
> false positive from true ones.
>
> If someone knows a public webservice that has an HTTPs interface with
> simple message I would be glad to provide an Axis2/C test program.
>
> Olivier.
>
>

Mime
View raw message