[prev in list] [next in list] [prev in thread] [next in thread] 

List:       axis-dev
Subject:    [jira] [Updated] (AXIS-2674) MethodCache does not clean properly, leading to classloader leaking
From:       "Andreas Veithen (JIRA)" <axis-dev () ws ! apache ! org>
Date:       2012-10-28 16:27:12
Message-ID: 791312139.36668.1351441632717.JavaMail.jiratomcat () arcas
[Download RAW message or body]


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

Andreas Veithen updated AXIS-2674:
----------------------------------

    Labels: classloader-leak  (was: )
    
> MethodCache does not clean properly, leading to classloader leaking
> -------------------------------------------------------------------
> 
> Key: AXIS-2674
> URL: https://issues.apache.org/jira/browse/AXIS-2674
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.3, 1.4
> Reporter: David Delbecq
> Priority: Critical
> Labels: classloader-leak
> 
> In org.apache.axis.utils.cache.MethodCache, the cache is handled using \
> ThreadLocals. That mean each Thread calling MethodCache has it's own cache. \
> However, the method  public void clearCache() {
> Map map = (Map) cache.get();
> if (map != null) {
> map.clear();
> }
> }
> This only reset the cache of current Thread. Other Thread's cache are left \
> untouched. This is a problem in an environment like tomcat, where the clearCache() \
> will be called by one Thread at webapp undeploy while the caches have been created \
> for various calling Http-Thread. Those HttpThread now contains via ThreadLocal \
> implicit reference to content of cache, which contains references to classes which \
> themself contains natural reference to their classloader. As such, unless you \
> discard all Http Threads, it's impossible to garbage collect content of caches and \
> as such the webapp classloader that is referenced by them is not garbage collected. \
> This result in whole webapplication not garbage collected at undeploy. Possible \
> solutions to clean whole cache: 1)
> public void clearCache() {
> cache = null;
> }
> 2)
> public void clearCache() {
> cache = new ThreadLocal();
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic