axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dustin Amrhein (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AXIS2-3011) ServiceDescription caching leads to memory leak
Date Thu, 26 Jul 2007 17:08:05 GMT

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

Dustin Amrhein commented on AXIS2-3011:
---------------------------------------

Just a follow-up to explain my comments above....
Suppose in a single appserver Module A, Module B, Module C, and Module D are all deployed.
Module A and Module B both have a service client that refers to a service (say {http://example}MyService)
Module C and Module D both contain different versions of MyService. Module A points to the
service in
Module C and Module B points to the same service in Module D. It seems that sharing a ConfigurationContext
between the clients in Module A and Module B could be harmful. What do you think?

> 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


Mime
View raw message