public void doFilter(ServeletRequest request, ServletResponse){
try{

//set ThreadLocal variable
chain.doFilter(request, response)

}finally{
//remove threadLocal variable.
}
}

Read more: http://javarevisited.blogspot.com/2013/01/threadlocal-memory-leak-in-java-web.html#ixzz2K6DrCkrJ

Advertisements