I am using Axis2c 1.6 

 

for one of the webservice the response is huge, the response XML is around 800 
MB

while invoking this service from my Webservice Client which is using axis2c, 
the memory usage of th process goes to around 5 GB when 
axis2_svc_client_send_receive call is started

is their any way to tune this ? any options etc that can set on the client side

is their any way to stream the response to a file instead of caching in the 
memory, I do see a method to write to file (axiom_xml_writer_create), but that 
can be called after this call is done so that is not useful

 

following is the code, other thing is I am calling all the requierd free 
functions, but even after that the process memory doesn't go down is this a bug?

 

axiom_node_t * node = NULL;
node = axis2_svc_client_send_receive(_wsf_service_client, _env, firstChild);

if(node == NULL)
{
throw Error("Error");
}

if (axis2_svc_client_get_last_response_has_fault(_wsf_service_client, _env))
{
//handle fault

}
else
{
axis2_char_t* xmlreply = NULL;
axiom_xml_writer_t *xml_writer = NULL;
axiom_output_t* om_output = NULL;
xml_writer = axiom_xml_writer_create_for_memory(_env, NULL, AXIS2_TRUE, 0, 
AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axiom_output_create(_env, xml_writer);
axiom_namespace_t* ns_xsi =  axiom_namespace_create(_env, 
"http://www.w3.org/2001/XMLSchema-instance";, "xsi");
axiom_element_t* node_ele  = (axiom_element_t*) 
axiom_node_get_data_element(node, _env);
axiom_element_declare_namespace_assume_param_ownership(node_ele, _env, ns_xsi);
axiom_node_serialize_sub_tree(node, _env, om_output);
xmlreply = (axis2_char_t*)axiom_xml_writer_get_xml(xml_writer, _env);
axiom_node_free_tree(node, _env);
}

if (om_output)
{
     axiom_output_free(om_output, env);
     om_output = NULL;
}

if (wsf_service_client)
{
axis2_svc_client_free(wsf_service_client, env);
wsf_service_client = NULL;
}

if(om_builder)
{
    axiom_stax_builder_free(om_builder, env);
om_builder = NULL;
}

if (env)
{
axutil_env_free((axutil_env_t *) env);
env = NULL;
}

 

Thanks and Regards

Manoj
                                          

Reply via email to