Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-130

Memory Leaks with ThreadLocals in Tomcat

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.2
    • Affects Version/s: 2.0
    • Component/s: None
    • None
    • Environment:
      Fedora, Tomcat

      When running mongo 2.0 in a tomcat environment I can see the following logs in the catalina.out, and the tomcat web server can't be stopped any more without killing it, it seems that there's a non-deamon thread still hanging.

      SEVERE: A web application created a ThreadLocal with key of type [null] (value [com.mongodb.DBTCPConnector$1@d5ba1ef]) and a value of type [com.mongodb.DBTCPConnector.MyPort] (value [com.mongodb.DBTCPConnector$MyPort@7ae458c2]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.
      Jul 8, 2010 7:28:23 AM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
      SEVERE: A web application created a ThreadLocal with key of type [null] (value [com.mongodb.OutMessage$1@257f6796]) and a value of type [com.mongodb.OutMessage] (value [com.mongodb.OutMessage@4f69bc15]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.
      Jul 8, 2010 7:28:23 AM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
      SEVERE: A web application created a ThreadLocal with key of type [null] (value [com.mongodb.Response$1@26bb2f6e]) and a value of type [org.bson.BSONDecoder] (value [org.bson.BSONDecoder@4b26f29f]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.

        1. threadlocal1.patch
          2 kB
          Hans Meiser

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            klu2 Klaus Lehner
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: