Uploaded image for project: 'Stripes'
  1. STS-782

Stripes fails to remove values from a ThreadLocal variable in StripesFilter, Tomcat says


    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects versions: Release 1.5, Release 1.5.1, Release 1.5.2, Release 1.5.3, Release 1.5.4
    • Fix versions: Release 1.5.5, Release 1.6
    • Components: Context Management
    • Labels:
    • Environment:
      Tested on Debian+Tomcat6, FreeBSD+Tomcat6, Mac+Tomcat6
    • Sprint:


      When undeploying a web-app which is using the Stripes Framework, Tomcat complains about a ThreadLocal variable not being clean, which would cause a memory leak. The exact error message is:

      The web application [] created a ThreadLocal with key of type [null] (value [net.sourceforge.stripes.controller.StripesFilter$1@68de59f0]) and a value of type [java.lang.Boolean] (value [true]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.

      And in fact, it does create a memory leak, since reloading the webapp few times brings an OutOfMemoryError to the log.

      I had a look at StripesFilter source code, and I coded a quick patch to fix this. It is working now, no memory leak. I could send you the patch file if you want to, but I just had to add one line to StripesFilter.java

      Here it is:

      — src/net/sourceforge/stripes/controller/StripesFilter.java (revision: 1343)
      +++ src/net/sourceforge/stripes/controller/StripesFilter.java (working copy)
      @@ -257,6 +257,7 @@

      // Once the request is processed, take the Configuration back out of thread local
      + StripesFilter.initialInvocation.remove();




            • Assignee:
              bengunter BenB
              rupper Roger de la Fuente
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: