You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Jarek Gawor (JIRA)" <ji...@apache.org> on 2007/07/30 16:42:53 UTC

[jira] Reopened: (AXIS2-3011) ServiceDescription caching leads to memory leak

     [ https://issues.apache.org/jira/browse/AXIS2-3011?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jarek Gawor reopened AXIS2-3011:
--------------------------------


The changes I committed were related to the affected code but they only make things slightly more efficient by creating less configuration contexts.

I'm re-opening this bug because I believe the original issue I described here still stands for the following reasons:

1) If somebody downloads Axis2 and writes a standalone JAX-WS client, he/she will find out that after a few (hundred) calls, the client will run out of memory. So I think this needs to be changed somehow, e.g. to disable caching, reuse some configuration, etc. 

2) The original issue of clearing the cache was not addressed. Once a ServiceDescription gets cached, it will always live there in the cache. There should be some functions defined that can clear the entire cache or a part of the cache based on the configuration context instance, etc. For example, in an app server, once a module is unloaded I would like to remove all cached ServiceDescriptions associated with that module.  Or when wsdl file for the service is changed, I would like the cached ServiceDescritpion to re-initialize.


> ServiceDescription caching leads to memory leak
> -----------------------------------------------
>
>                 Key: AXIS2-3011
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3011
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: jaxws
>            Reporter: Jarek Gawor
>            Assignee: Ann Robinson
>         Attachments: AXIS2-3011.patch
>
>
> The DescriptionFactoryImpl.createServiceDescription() function attempts to cache/reuse the ServiceDescription objects and that leads to memory leaks.
> First, a Hashtable is used for the cache. That means, any ServiceDescription created will always live in the cache and won't ever be reclaimed (and there is no clear cache function). Some sort of WeakHashMap could help the problem so that at least some unused ServiceDescription objects could be reclaimed. 
> Second, the createServiceDescription() uses the DescriptionFactory.createClientConfigurationFactory().getClientConfigurationContext() to get the client configuration context. It looks like by default the ClientConfigurationFactory.getClientConfigurationContext() does NOT cache the configuration context. Therefore, each call creates a new configuration object. That means, that by default ServiceDescription will NOT be reused since the configuration context object instance is used to determine if the ServiceDescription should be reused or not (see DescriptionKey.equals() function). 
> So, a simple program that calls createServiceDescription() repeatably in a loop (with the same arguments) will quickly run out of memory. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org