resthub / springmvc-router

Adds route mapping capacity to any "Spring MVC based" webapp. Uses playframework.org Router implementation.

Home Page:http://resthub.github.com/springmvc-router/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Leaking ThreadLocal

msiedlarek opened this issue · comments

I've just noticed this message when Tomcat 7 undeployed my application:

Nov 02, 2013 7:54:22 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/someapp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@77bb96da]) and a value of type [org.resthub.web.springmvc.router.HTTPRequestAdapter] (value [org.resthub.web.springmvc.router.HTTPRequestAdapter@32e552c3]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

I'll try to update that code and use Spring's request context holder instead of managing threadlocals myself.