You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (JIRA)" <ji...@apache.org> on 2011/01/08 20:38:46 UTC

[jira] Resolved: (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 ]

Igor Vaynberg resolved WICKET-3312.
-----------------------------------

    Resolution: Invalid
      Assignee: Igor Vaynberg

can you provide some log output of this and a simple quickstart that reproduces it?

doesnt make sense that memory "leaks", it is a threadlocal so there will be as many entries as there are threads in the server's threadpool - but not more.

your patch is bad because simpledateformat is not threadsafe, so your patch will cause concurrency errors. if we remove the threadlocal we have to sync on the formats, but that is not as efficient as using a threadlocal.

i will close this until you provide the logs and/or a quickstart.

> 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
>            Assignee: Igor Vaynberg
>            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.