Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-2597

Some threads not being stopped after closing connection/connection factory in webapp

    XMLWordPrintable

Details

    • Bug
    • Status: Done
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • core apis
    • None
    • Java jdk 1.7.0_45
      Tomcat 7.0.55
      Centos 6.4
      OpenDJ SDK 2.6.9

    Description

      Using the DJ SDK in a webapp deployed on Tomcat, I see an issue where some of the threads created by the SDK are still running when the app is undeployed.

      I've attached an example project (dj-shutdown-test.zip) which shows the issue. This connects to a DJ instance and starts a psearch on startup and then cancels the psearch and closes the Connection and ConnectionFactory on shutdown. In the logs I get the following:

      Shutting down connection to DJ
      Connection to DJ closed
      Aug 04, 2014 10:43:59 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
      SEVERE: The web application [/dj] appears to have started a thread named [OpenDJ LDAP SDK Default Scheduler] but has failed to stop it. This is very likely to create a memory leak.
      Aug 04, 2014 10:43:59 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
      SEVERE: The web application [/dj] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@3aa468c]) and a value of type [org.glassfish.grizzly.ThreadCache.ObjectCache] (value [org.glassfish.grizzly.ThreadCache$ObjectCache@7ba74bb9]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
      Aug 04, 2014 10:43:59 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
      SEVERE: The web application [/dj] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@3aa468c]) and a value of type [org.glassfish.grizzly.ThreadCache.ObjectCache] (value [org.glassfish.grizzly.ThreadCache$ObjectCache@3af08028]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

      Attachments

        Issue Links

          Activity

            People

              matthew Matthew Swift
              chris.clifton Chris Clifton
              Matthew Swift Matthew Swift
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: