You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Marcus Better <ma...@better.se> on 2010/06/11 15:13:53 UTC

Timer leak detection, false positives

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I run a Grails app on Tomcat 6.0.26 (OpenJDK 6, Debian). When undeploying, 
it reports several leaked objects, including a timer thread that was left 
running.

This thread belongs to EhCache, and by inspecting the code, it looks like 
the timer should be cancelled properly when the application is shut down. 
Therefore I suspect that it might be a false positive. Is this likely or 
not?

The app uses Spring's EhCacheManagerFactoryBean, which calls 
EhCacheManager.shutdown() during application context shutdown. That in turn 
calls cancel() and purge() on the Timer.

Cheers,

Marcus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkwSNpIACgkQXjXn6TzcAQnjvgCg6K4tHVM9v2hFB4IBOYnPOeij
7EEAoI/5JtwAbb3BvD5JP/cvmOZWvlBw
=tsrG
-----END PGP SIGNATURE-----



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Timer leak detection, false positives

Posted by Marcus Better <ma...@better.se>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark Thomas wrote:
>> This thread belongs to EhCache, and by inspecting the code, it looks like
>> the timer should be cancelled properly when the application is shut down.

> Does the app wait for the thread to stop or does it just cary on?

It doesn't wait, from what I can see. So that could explain it.

Cheers,

Marcus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkwSiJMACgkQXjXn6TzcAQnSjQCfQLGZj51Zz8mv8SHXt4h0Cl6A
Zx0An1Ac31VgDNL2ZdSqduMoboXpVzet
=1dWL
-----END PGP SIGNATURE-----



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Timer leak detection, false positives

Posted by Mark Thomas <ma...@apache.org>.
On 11/06/2010 14:13, Marcus Better wrote:
> Hi,
> 
> I run a Grails app on Tomcat 6.0.26 (OpenJDK 6, Debian). When undeploying, 
> it reports several leaked objects, including a timer thread that was left 
> running.
> 
> This thread belongs to EhCache, and by inspecting the code, it looks like 
> the timer should be cancelled properly when the application is shut down. 
> Therefore I suspect that it might be a false positive. Is this likely or 
> not?

Does the app wait for the thread to stop or does it just cary on? If it
doesn't wait then there is a good chance the thread will still be
running when Tomcat checks for leaks and hence will get reported.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Timer leak detection, false positives

Posted by Pid <pi...@pidster.com>.
On 11/06/2010 14:13, Marcus Better wrote:
> Hi,
> 
> I run a Grails app on Tomcat 6.0.26 (OpenJDK 6, Debian). When undeploying,
> it reports several leaked objects, including a timer thread that was left
> running.
> 
> This thread belongs to EhCache, and by inspecting the code, it looks like
> the timer should be cancelled properly when the application is shut down.
> Therefore I suspect that it might be a false positive. Is this likely or
> not?

It's possible.

Can you build a small test case in web app form that replicates this?


p

> The app uses Spring's EhCacheManagerFactoryBean, which calls
> EhCacheManager.shutdown() during application context shutdown. That in turn
> calls cancel() and purge() on the Timer.
> 
> Cheers,
> 
> Marcus

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org