Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.2 final
    • Fix Version/s: 2.0.4, 2.1-RC2
    • Component/s: Project infrastructure
    • Labels:
      None
    • Environment:
      Win32, Tomcat 6.0.20 / 6.0.24

      Description

      When deploying a minimal Grails application to Tomcat 6.0.20 on Windows, everything works fine. When the same application is undeployed, the following libraries are locked and cannot be removed by Tomcat.

      • ehcache-core-1.7.1.jar
      • groovy-all-1.6.7.jar
      • grails-core-1.2.0.jar

      The same problem also happens if the application is configured to use the MSSQL JDBC 2.0 driver. The first time the application is deployed the database connections work fine, when the application is undeployed it does not remove the driver's JAR file and also subsequent deployments fail with JDBC connection issues.

      When deploying the exact same application on Tomcat 6.0.24 on Windows, none of the problems mentioned above occur. However the Tomcat log contains a bunch of errors like the following...

      SEVERE: A web application created a ThreadLocal with key of type [org.codehaus.groovy.runtime.GroovyCategorySupport.MyThreadLocal] (value [org.codehaus.groovy.runtime.GroovyCategorySupport$MyThreadLocal@d32ea0]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@9a288b]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.

      The full log file is attached to this issue as well as the sample grails application which triggers these errors.

      The purpose of the issue would be to fix the locking issues under Tomcat 6.0.20 and to clean up the SEVERE messages in the log file under Tomcat 6.0.24.

      Please let me know if you require any additional information. Thanks!

      1. abstract-save-persistent-leak.patch
        2 kB
        R
      2. catalina.2010-01-29.log
        13 kB
        Daniel Mikusa
      3. grails121.log
        16 kB
        Daniel Mikusa
      4. hibernate-persistence-context-leak.patch
        2 kB
        R

        Activity

        Show
        Vitalii Samolovskikh added a comment - Sorry http://stackoverflow.com/questions/23813000/error-messages-when-shutting-down-tomcat-with-a-grails-web-app-with-embedded-h2
        Hide
        Vitalii Samolovskikh added a comment -

        Please, reopen it. I can't.

        Show
        Vitalii Samolovskikh added a comment - Please, reopen it. I can't.
        Hide
        Saurabh added a comment -

        I am getting exactly the same error as mentioned by Vitalli. But my use case is different. I am using Quartz job to do some backend processing, which result into bulk upload to database.
        I am explicitly clearing up the session as given below.

        SomeDomain.saveAll(collectionOfDomain)
        sessionFactory.currentSession.flush();
        sessionFactory.currentSession.clear()

        When we stop the server, I see following logs

        INFO: Destroying Spring FrameworkServlet 'grails'
        Jul 24, 2014 7:27:46 PM org.apache.catalina.core.ApplicationContext log
        INFO: Destroying Spring FrameworkServlet 'gsp'
        Jul 24, 2014 7:27:46 PM org.apache.catalina.core.ApplicationContext log
        INFO: Closing Spring root WebApplicationContext
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e]) and a value of type [java.util.HashMap] (value [{}]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0]) and a value of type [java.util.HashMap] (value [

        {DEFAULT=0}]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e]) and a value of type [java.util.HashMap] (value [{}]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0]) and a value of type [java.util.HashMap] (value [{DEFAULT=0}

        ]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e]) and a value of type [java.util.HashMap] (value [{}]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0]) and a value of type [java.util.HashMap] (value [

        {DEFAULT=0}]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e]) and a value of type [java.util.HashMap] (value [{}]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0]) and a value of type [java.util.HashMap] (value [{DEFAULT=0}

        ]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e]) and a value of type [java.util.HashMap] (value [{}]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0]) and a value of type [java.util.HashMap] (value [

        {DEFAULT=0}]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e]) and a value of type [java.util.HashMap] (value [{}]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0]) and a value of type [java.util.HashMap] (value [{DEFAULT=0}

        ]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e]) and a value of type [java.util.HashMap] (value [{}]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0]) and a value of type [java.util.HashMap] (value [

        {DEFAULT=0}]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e]) and a value of type [java.util.HashMap] (value [{}]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0]) and a value of type [java.util.HashMap] (value [{DEFAULT=0}

        ]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e]) and a value of type [java.util.HashMap] (value [{}]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0]) and a value of type [java.util.HashMap] (value [

        {DEFAULT=0}]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e]) and a value of type [java.util.HashMap] (value [{}]) 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.
        Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
        SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0]) and a value of type [java.util.HashMap] (value [{DEFAULT=0}

        ]) 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.

        Show
        Saurabh added a comment - I am getting exactly the same error as mentioned by Vitalli. But my use case is different. I am using Quartz job to do some backend processing, which result into bulk upload to database. I am explicitly clearing up the session as given below. SomeDomain.saveAll(collectionOfDomain) sessionFactory.currentSession.flush(); sessionFactory.currentSession.clear() When we stop the server, I see following logs INFO: Destroying Spring FrameworkServlet 'grails' Jul 24, 2014 7:27:46 PM org.apache.catalina.core.ApplicationContext log INFO: Destroying Spring FrameworkServlet 'gsp' Jul 24, 2014 7:27:46 PM org.apache.catalina.core.ApplicationContext log INFO: Closing Spring root WebApplicationContext Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e] ) and a value of type [java.util.HashMap] (value [{}] ) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0] ) and a value of type [java.util.HashMap] (value [ {DEFAULT=0}]) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e] ) and a value of type [java.util.HashMap] (value [{}] ) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0] ) and a value of type [java.util.HashMap] (value [{DEFAULT=0} ]) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e] ) and a value of type [java.util.HashMap] (value [{}] ) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0] ) and a value of type [java.util.HashMap] (value [ {DEFAULT=0}]) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e] ) and a value of type [java.util.HashMap] (value [{}] ) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0] ) and a value of type [java.util.HashMap] (value [{DEFAULT=0} ]) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e] ) and a value of type [java.util.HashMap] (value [{}] ) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0] ) and a value of type [java.util.HashMap] (value [ {DEFAULT=0}]) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e] ) and a value of type [java.util.HashMap] (value [{}] ) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0] ) and a value of type [java.util.HashMap] (value [{DEFAULT=0} ]) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e] ) and a value of type [java.util.HashMap] (value [{}] ) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0] ) and a value of type [java.util.HashMap] (value [ {DEFAULT=0}]) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e] ) and a value of type [java.util.HashMap] (value [{}] ) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0] ) and a value of type [java.util.HashMap] (value [{DEFAULT=0} ]) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e] ) and a value of type [java.util.HashMap] (value [{}] ) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0] ) and a value of type [java.util.HashMap] (value [ {DEFAULT=0}]) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1@45331d5e] ) and a value of type [java.util.HashMap] (value [{}] ) 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. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2@1ecd29d0] ) and a value of type [java.util.HashMap] (value [{DEFAULT=0} ]) 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.
        Hide
        Rasul Shishehbor added a comment -

        Ditto here, we're seeing this at application shutdown * X (number of instances logged increase based on application activity).

        "created a ThreadLocal with key of type [org.grails.datastore.mapping.core.SoftThreadLocalMap] (value [org.grails.datastore.mapping.core.SoftThreadLocalMap@20e51df2]) and a value of type [org.apache.commons.collections.map.ReferenceMap] (value [{}]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak."

        Our backend data sources are Oracle...

        Not all ReferenceMaps are empty, some contain domain instances for values, etc.

        Show
        Rasul Shishehbor added a comment - Ditto here, we're seeing this at application shutdown * X (number of instances logged increase based on application activity). "created a ThreadLocal with key of type [org.grails.datastore.mapping.core.SoftThreadLocalMap] (value [org.grails.datastore.mapping.core.SoftThreadLocalMap@20e51df2] ) and a value of type [org.apache.commons.collections.map.ReferenceMap] (value [{}] ) but failed to remove it when the web application was stopped. This is very likely to create a memory leak." Our backend data sources are Oracle... Not all ReferenceMaps are empty, some contain domain instances for values, etc.
        Hide
        Rasul Shishehbor added a comment -

        Looking at: DomainClassGrailsPlugin

        Where does the
        static final PROPERTY_INSTANCE_MAP = new SoftThreadLocalMap()

        get removed?

        In ValidationGrailsPlugin it looks like an attempt was made to remove it via a closure:

        static final ThreadLocal PROPERTY_INSTANCE_MAP = new SoftThreadLocalMap()

        static {
        ShutdownOperations.addOperation(

        { PROPERTY_INSTANCE_MAP.remove() }

        as Runnable)
        }

        But nothing like that is done in the DomainClassGrailsPlugin.

        Show
        Rasul Shishehbor added a comment - Looking at: DomainClassGrailsPlugin Where does the static final PROPERTY_INSTANCE_MAP = new SoftThreadLocalMap() get removed? In ValidationGrailsPlugin it looks like an attempt was made to remove it via a closure: static final ThreadLocal PROPERTY_INSTANCE_MAP = new SoftThreadLocalMap() static { ShutdownOperations.addOperation( { PROPERTY_INSTANCE_MAP.remove() } as Runnable) } But nothing like that is done in the DomainClassGrailsPlugin.

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Daniel Mikusa
          • Votes:
            28 Vote for this issue
            Watchers:
            30 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Last Reviewed: