You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Attila Király (JIRA)" <ji...@apache.org> on 2011/01/07 13:29:46 UTC

[jira] Updated: (WICKET-3312) Tomcat complains about thread local memory leaking when using wickets XForwardedRequestWrapperFactory

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

Attila Király updated WICKET-3312:
----------------------------------

    Attachment: WICKET-3312.patch

Attaching a patch against current trunk. Tests pass, tomcat does not complain anymore.

Patch simply drops static threadlocal variable and uses instance variable to hold the SimpleDateFormat array.

> Tomcat complains about thread local memory leaking when using wickets XForwardedRequestWrapperFactory
> -----------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-3312
>                 URL: https://issues.apache.org/jira/browse/WICKET-3312
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.5-M3
>            Reporter: Attila Király
>            Priority: Minor
>         Attachments: WICKET-3312.patch
>
>
> o.a.w.protocol.http.servlet.XForwardedRequestWrapperFactory can be used to wrap incoming servlet request into o.a.w.protocol.http.servlet.XForwardedRequestWrapper objects. These objects store a SimpleDateFormat array in a private static thread local memory but theye are never cleared. Tomcats memory leak prevention listener detects when the webapp is stopped. Tomcat 7.0.5 logs several times the followings:
> 2011.01.07. 12:50:59 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
> SEVERE: The web application [/wtl] created a ThreadLocal with key of type [null] (value [org.apache.wicket.protocol.http.servlet.XForwardedRequestWrapper$1@6328edf2]) and a value of type [java.text.SimpleDateFormat[]] (value [[Ljava.text.SimpleDateFormat;@141dddba]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.