Quantcast

tomcat threadlocal memory leak & ERRORS objects?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

tomcat threadlocal memory leak & ERRORS objects?

camneely
When i build a new version of my app from Jenkins I first shutdown tomcat.  I am seeing these types of entries littering the catalina.out upon execution of $CATALINA_HOME/bin/shutdown.sh

Been searching for hours trying to find a solution.  anyone see this before and fix it?

I'm using 1.3.6 with spring security core, quartz, mail plugins


catalina.out  contents  ...

Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [Timer-1] but has failed to stop it. This is very likely to create a memory leak.
Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [Timer-2] but has failed to stop it. This is very likely to create a memory leak.
Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.validation.HibernateDomainClassValidator$1] (value [org.codehaus.groovy.grails.orm.hibernate.validation.HibernateDomainClassValidator$1@14c0104]) and a value of type [java.util.ArrayList] (value [[]]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
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@d6e7b8]) and a value of type [java.lang.Boolean] (value [false]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
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@106fc22]) and a value of type [java.lang.Integer] (value [0]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory$2] (value [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory$2@19320cf]) and a value of type [java.lang.Boolean] (value [false]) but failed to remove it when the web application was stopped. This is very likely to create a memory
Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.support.SoftThreadLocalMap] (value [org.codehaus.groovy.grails.support.SoftThreadLocalMap@4f0b5b]) and a value of type [org.apache.commons.collections.map.ReferenceMap] (value [{org.codehaus.groovy.grails.ERRORS_Rink_8128171=org.springframework.validation.BeanPropertyBindingResult: 0 errors, org.codehaus.groovy.grails.ERRORS_Season_27252330=org.springframework.validation.BeanPropertyBindingResult: 0 errors, org.codehaus.groovy.grails.ERRORS_UserRole_31941445=org.springframework.validation.BeanPropertyBindingResult: 0 errors, org.codehaus.groovy.grails.ERRORS_PlayerGame_25628909=org.springframework.validation.BeanPropertyBindingResult: 0 errors, org.codehaus.groovy.grails.ERRORS_PlayerGame_16058627=org.springframework.validation.BeanPropertyBindingResult: 0 errors,
.
.
.
.
.
.
.}]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tomcat threadlocal memory leak & ERRORS objects?

Graeme Rocher
Administrator
Are you using a quartz job or background thread? Might be this problem
http://burtbeckwith.com/blog/?p=73

This will be corrected in 1.4, in the meantime use the workaround

Cheers

On Fri, Apr 15, 2011 at 6:37 AM, camneely <[hidden email]> wrote:

> When i build a new version of my app from Jenkins I first shutdown tomcat.  I
> am seeing these types of entries littering the catalina.out upon execution
> of $CATALINA_HOME/bin/shutdown.sh
>
> Been searching for hours trying to find a solution.  anyone see this before
> and fix it?
>
> I'm using 1.3.6 with spring security core, quartz, mail plugins
>
>
> catalina.out  contents  ...
>
> Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader
> clearReferencesJdbc
> SEVERE: The web application [] registered the JDBC driver
> [com.mysql.jdbc.Driver] but failed to unregister it when the web application
> was stopped. To prevent a memory leak, the JDBC Driver has been forcibly
> unregistered.
> Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader
> clearReferencesThreads
> SEVERE: The web application [] appears to have started a thread named
> [Timer-1] but has failed to stop it. This is very likely to create a memory
> leak.
> Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader
> clearReferencesThreads
> SEVERE: The web application [] appears to have started a thread named
> [Timer-2] but has failed to stop it. This is very likely to create a memory
> leak.
> Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader
> clearThreadLocalMap
> SEVERE: The web application [] created a ThreadLocal with key of type
> [org.codehaus.groovy.grails.orm.hibernate.validation.HibernateDomainClassValidator$1]
> (value
> [org.codehaus.groovy.grails.orm.hibernate.validation.HibernateDomainClassValidator$1@14c0104])
> and a value of type [java.util.ArrayList] (value [[]]) but failed to remove
> it when the web application was stopped. This is very likely to create a
> memory leak.
> Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader
> clearThreadLocalMap
> 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@d6e7b8])
> and a value of type [java.lang.Boolean] (value [false]) but failed to remove
> it when the web application was stopped. This is very likely to create a
> memory leak.
> Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader
> clearThreadLocalMap
> 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@106fc22])
> and a value of type [java.lang.Integer] (value [0]) but failed to remove it
> when the web application was stopped. This is very likely to create a memory
> leak.
> Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader
> clearThreadLocalMap
> SEVERE: The web application [] created a ThreadLocal with key of type
> [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory$2]
> (value
> [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory$2@19320cf])
> and a value of type [java.lang.Boolean] (value [false]) but failed to remove
> it when the web application was stopped. This is very likely to create a
> memory
> Apr 14, 2011 11:18:44 PM org.apache.catalina.loader.WebappClassLoader
> clearThreadLocalMap
> SEVERE: The web application [] created a ThreadLocal with key of type
> [org.codehaus.groovy.grails.support.SoftThreadLocalMap] (value
> [org.codehaus.groovy.grails.support.SoftThreadLocalMap@4f0b5b]) and a value
> of type [org.apache.commons.collections.map.ReferenceMap] (value
> [{org.codehaus.groovy.grails.ERRORS_Rink_8128171=org.springframework.validation.BeanPropertyBindingResult:
> 0 errors,
> org.codehaus.groovy.grails.ERRORS_Season_27252330=org.springframework.validation.BeanPropertyBindingResult:
> 0 errors,
> org.codehaus.groovy.grails.ERRORS_UserRole_31941445=org.springframework.validation.BeanPropertyBindingResult:
> 0 errors,
> org.codehaus.groovy.grails.ERRORS_PlayerGame_25628909=org.springframework.validation.BeanPropertyBindingResult:
> 0 errors,
> org.codehaus.groovy.grails.ERRORS_PlayerGame_16058627=org.springframework.validation.BeanPropertyBindingResult:
> 0 errors,
> .
> .
> .
> .
> .
> .
> .}]) but failed to remove it when the web application was stopped. This is
> very likely to create a memory leak.
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/tomcat-threadlocal-memory-leak-ERRORS-objects-tp3451236p3451236.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



--
Graeme Rocher
Grails Project Lead
SpringSource - A Division of VMware
http://www.springsource.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tomcat threadlocal memory leak & ERRORS objects?

davide.cavestro
Hi Graeme,
we are experiencing a bunch of possible memory leaks from tomcat regarding HibernatePersistenceContextInterceptor, ReloadAwareAutowireCapableBeanFactory, HibernateDomainClassValidator thread locals (implemented as inner classes).
From a fast read of  and I see the issue seems only related to SoftThreadLocalMap.
I have some questions:
* What about the other thread locals? Are they considered acceptable as they keeps up only Integer and Boolean references (nothing as compared with validation errors/domain classes)? Is that true?
* Is there an issue on jira for 1.4 changes?

Cheers
Davide

Graeme Rocher-4 wrote
Are you using a quartz job or background thread? Might be this problem
http://burtbeckwith.com/blog/?p=73

This will be corrected in 1.4, in the meantime use the workaround

Cheers

On Fri, Apr 15, 2011 at 6:37 AM, camneely <[hidden email]> wrote:
> When i build a new version of my app from Jenkins I first shutdown tomcat.  I
> am seeing these types of entries littering the catalina.out upon execution
> of $CATALINA_HOME/bin/shutdown.sh
>
> Been searching for hours trying to find a solution.  anyone see this before
> and fix it?
>
> I'm using 1.3.6 with spring security core, quartz, mail plugins
>
>
Loading...