Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004376 [Hessian] major always 02-07-11 05:11 02-26-12 03:51
Reporter p_wright View Status public  
Assigned To
Priority normal Resolution open Platform
Status new   OS
Projection none   OS Version
ETA none Fixed in Version Product Version 4.0.13
  Product Build
Summary 0004376: Memory leak due to ServiceContext not clearing ThreadLocal
Description HessianServlet sets up a ServiceContext type for convenience, this uses a ThreadLocal to store an instance of ServiceContext however when the service call completes it does not clean up the ThreadLocal. This dangling ThreadLocal reference prevents Tomcat from freeing the ClassLoader associated with the webapp.

It looks like ServiceContext.end() should call _localContext.remove()
Steps To Reproduce
Additional Information The error message produced by Tomcat 7:


SEVERE: The web application [/hessianwebapp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@655e3dc4]) and a value of type [com.caucho.services.server.ServiceContext] (value [com.caucho.services.server.ServiceContext@e2942da]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
07-Feb-2011 12:56:31 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/hessianwebapp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@655e3dc4]) and a value of type [com.caucho.services.server.ServiceContext] (value [com.caucho.services.server.ServiceContext@36e3fd79]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
07-Feb-2011 12:56:31 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/hessianwebapp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@655e3dc4]) and a value of type [com.caucho.services.server.ServiceContext] (value [com.caucho.services.server.ServiceContext@32162f16]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
07-Feb-2011 12:56:31 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/hessianwebapp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@655e3dc4]) and a value of type [com.caucho.services.server.ServiceContext] (value [com.caucho.services.server.ServiceContext@4e6d670a]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
07-Feb-2011 12:56:31 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/hessianwebapp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@655e3dc4]) and a value of type [com.caucho.services.server.ServiceContext] (value [com.caucho.services.server.ServiceContext@7087e9bf]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
07-Feb-2011 12:56:31 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/hessianwebapp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@655e3dc4]) and a value of type [com.caucho.services.server.ServiceContext] (value [com.caucho.services.server.ServiceContext@6b033450]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
07-Feb-2011 12:56:31 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/hessianwebapp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@655e3dc4]) and a value of type [com.caucho.services.server.ServiceContext] (value [com.caucho.services.server.ServiceContext@1f5fa713]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
07-Feb-2011 12:56:31 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/hessianwebapp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@655e3dc4]) and a value of type [com.caucho.services.server.ServiceContext] (value [com.caucho.services.server.ServiceContext@40d1e07c]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Attached Files

- Relationships

- Notes
(0005702)
mate
02-26-12 03:51

I believe this was fixed in 4.0.23
 

- Issue History
Date Modified Username Field Change
02-07-11 05:11 p_wright New Issue
02-26-12 03:51 mate Note Added: 0005702


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker