How to fix memory leak in Axis2/C client?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to fix memory leak in Axis2/C client?

Olivier Mengué-2
How to fix memory leak in Axis2/C client?

Hi,

I have an Axis2/C client that does multiple calls to the same web service.
So I'm reusing the same axis2_svc_client object.
The WSDL was too complex for the WSDL code generator, so I had to create the code myself.

The client call works fine.
However my problem is I have a memory leak in every calls to the service.

I have the following calls to Axis:
* init:
    - axutil_env_create_all()
    - axis2_svc_client_create()
    - axis2_options_create()
    - axis2_options_set_to()
    - axis2_options_set_soap_version()
    - axis2_svc_client_set_proxy()
    - axis2_svc_client_set_options()
* done:
    - axis2_svc_client_free()
    - axutil_env_free
* for every call to the service:
    - I construct the XML request document:
        + axutil_qname_create()
        + axiom_element_create_with_qname()
        + axiom_element_create(), axiom_element_set_text()
    - axis2c_svc_client_send_receive()
    - I parse the XML response document:
        + axis2c_svc_client_get_http_status_code()
        + axis2c_svc_client_get_last_response_has_fault()
        + axiom_node_get_n,ext_sibling()
        + axiom_node_get_node_type()
        + axiom_node_get_data_element(), axiom_node_get_localname(), axiom_node_get_namespace(), axiom_node_get_text()


I suspect that either the request XML tree and the response XML tree are not freed,
but I've seen nothing in the axis2c_svc_client API to do that.

Which function calls are missing to fix my leak?

Olivier.

Reply | Threaded
Open this post in threaded view
|

Re: How to fix memory leak in Axis2/C client?

Samisa Abeysinghe-4
It is hard to tell from the list of methods given. Can you please provide the code you are using to test? Then we can profile and see where the leaks are. 

Samisa...

2010/3/4 Olivier Mengué <[hidden email]>

Hi,

I have an Axis2/C client that does multiple calls to the same web service.
So I'm reusing the same axis2_svc_client object.
The WSDL was too complex for the WSDL code generator, so I had to create the code myself.

The client call works fine.
However my problem is I have a memory leak in every calls to the service.

I have the following calls to Axis:
* init:
    - axutil_env_create_all()
    - axis2_svc_client_create()
    - axis2_options_create()
    - axis2_options_set_to()
    - axis2_options_set_soap_version()
    - axis2_svc_client_set_proxy()
    - axis2_svc_client_set_options()
* done:
    - axis2_svc_client_free()
    - axutil_env_free
* for every call to the service:
    - I construct the XML request document:
        + axutil_qname_create()
        + axiom_element_create_with_qname()
        + axiom_element_create(), axiom_element_set_text()
    - axis2c_svc_client_send_receive()
    - I parse the XML response document:
        + axis2c_svc_client_get_http_status_code()
        + axis2c_svc_client_get_last_response_has_fault()
        + axiom_node_get_n,ext_sibling()
        + axiom_node_get_node_type()
        + axiom_node_get_data_element(), axiom_node_get_localname(), axiom_node_get_namespace(), axiom_node_get_text()


I suspect that either the request XML tree and the response XML tree are not freed,
but I've seen nothing in the axis2c_svc_client API to do that.

Which function calls are missing to fix my leak?

Olivier.




--
Samisa Abeysinghe
Director, Engineering - WSO2 Inc.

http://wso2.com/ - "lean . enterprise . middleware"
Reply | Threaded
Open this post in threaded view
|

RE : How to fix memory leak in Axis2/C client?

Olivier Mengué-2
RE : How to fix memory leak in Axis2/C client?

Samisa Abeysinghe wrote:
>It is hard to tell from the list of methods given. Can you please provide
>the code you are using to test? Then we can profile and see where the leaks
>are.

As you probably expected, no, I can't.

Could you at least tell me if I have a good understanding of the API?
Is it my responsability to free the XML trees used in the SOAP exchange?

Or if it may be a bug such as AXIS2C-1452?

>> * for every call to the service:
>>     - I construct the XML request document:
>>         + axutil_qname_create()
>>         + axiom_element_create_with_qname()
>>         + axiom_element_create(), axiom_element_set_text()
>>     - axis2c_svc_client_send_receive()
>>     - I parse the XML response document:
>>         + axis2c_svc_client_get_http_status_code()
>>         + axis2c_svc_client_get_last_response_has_fault()
>>         + axiom_node_get_n,ext_sibling()
>>         + axiom_node_get_node_type()
>>         + axiom_node_get_data_element(), axiom_node_get_localname(),
>> axiom_node_get_namespace(), axiom_node_get_text()
>>
>>
>> I suspect that either the request XML tree and the response XML tree are
>> not freed,
>> but I've seen nothing in the axis2c_svc_client API to do that.
>>
>> Which function calls are missing to fix my leak?
>>
>> Olivier.
>>

Olivier Mengué
Oxymel, France.