[ https://issues.apache.org/jira/browse/ODE-802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15132271#comment-15132271 ]
Igor Vorobiov commented on ODE-802: ----------------------------------- Memory leak is caused by accumulation of anonymous axis service groups in the axis configuration. When we create service client with null service argument then anonymous service is created. client = new ServiceClient(_configContext, null); After setting necessary service to client anonymous service is removed but it's service group is still in the axis configuration: client.setAxisService(anonymousService); So to workaround incomplete cleanup need to remove anonymous service group from axis configuration after we finished to work with client. _axisConfig.removeServiceGroup(serviceClientInfo.getAnonServiceName()); I tried to delete it immediately after setting axis service but I always have following error for one service call from 2k(so finally block is right place for it): org.apache.axis2.AxisFault: The axis_service_for_{some name} service, which is not valid, does not belong to the axis_service_for_{some name} service group. There is fixed SoapExternalService class in the attached zip. You can also noticed that _cachedClients functionality removed from getServiceClient method. It is done due to some other high loading problems I faced before. So it can be skipped for memory leak fix. The main fix is adding finally block where we need to have name of anonymous client for deleting service group from axis configuration. > Fix a potential memory leak in SoapExternalService > -------------------------------------------------- > > Key: ODE-802 > URL: https://issues.apache.org/jira/browse/ODE-802 > Project: ODE > Issue Type: Bug > Components: Axis2 Integration > Reporter: Tammo van Lessen > Priority: Minor > Fix For: 1.4 > > Attachments: fix_SoapExternalService.zip > > > via Karthick: When creating a service client and setting the service, Axis2 > leaks uncleaned anonymous clients. Results in a memory leak. > A attempt to fix that has been committed with r790694 but lead to ODE-647 so > that the commit has been reverted. An uncompleted patch has been attached to > this ticket, which can help to fix this issue if the memory leak appears to > be severe. -- This message was sent by Atlassian JIRA (v6.3.4#6332)