Bug 43552 - Memory leak on application reload apparently caused by commons-pool 1.3
Summary: Memory leak on application reload apparently caused by commons-pool 1.3
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 5.5.24
Hardware: Other other
: P2 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2007-10-04 08:02 UTC by Cott Lang
Modified: 2008-01-20 09:09 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Cott Lang 2007-10-04 08:02:06 UTC
I am seeing commons-pool's EVICTION_TIMER causing applications not to unload,
using Edward Chou's modified JHAT that assists in tracking classloader leaks.

--> java.lang.reflect.Method@0x2aaab4902360 (145 bytes)  (field clazz:) exclude
--> class org.apache.catalina.startup.Catalina (160 bytes) (??:) exclude
--> org.apache.catalina.loader.StandardClassLoader@0x2aaab482c6e8 (123 bytes)
(field parent:) exclude
--> org.apache.catalina.loader.StandardClassLoader@0x2aaab480eab0 (123 bytes)
(field classes:) exclude
--> java.util.Vector@0x2aaab4815d98 (36 bytes) (field elementData:) exclude
--> [Ljava.lang.Object;@0x2aaab4b545f8 (10256 bytes) (Element 21 of
[Ljava.lang.Object;@0x2aaab4b545f8:) exclude
--> class org.apache.tomcat.dbcp.pool.impl.GenericObjectPool (160 bytes) (static
field EVICTION_TIMER:) exclude
--> java.util.Timer@0x2aaab4732740 (40 bytes) (field thread:) exclude
--> java.util.TimerThread@0x2aaab494fa80 (173 bytes) (field contextClassLoader:)
--> org.apache.catalina.loader.WebappClassLoader@0x2aaab482b4e8 (288 bytes) exclude 

This appears to be directly related to the upgrade to commons-pool 1.3 in both
Tomcat 5.5.24 and Tomcat 6.0.11. Copying the commons-pool 1.2 based JAR from
Tomcat 5.5.20 seems to solve the problem in 5.5.25 and 6.0.14 with no readily
apparent side effects in my admittedly limited testing of my own apps.

This has been reported in https://issues.apache.org/jira/browse/POOL-97 but
doesn't appear to be rapidly heading towards a solution.

Any chance of reverting to 1.2 to fix this leak?
Comment 1 Mark Thomas 2007-12-01 12:25:50 UTC
I have proposed reverting to 1.2 on the dev list. I'll update this bug report
when the discussion of that proposal reaches a conclusion. Feel free to add your
$0.02 to the discussion.
Comment 2 Mark Thomas 2007-12-09 15:45:26 UTC
The current view is continue with pool 1.3. Those seeing the issue can use the
workaround you propose. Meanwhile, I am working with the commons-pool folks to
get a 1.4 out with a fix for this and a couple of other issues.
Comment 3 Cott Lang 2007-12-12 13:20:27 UTC
Thanks, Mark. I appreciate your help on this as well as your patch for commons
pool - so will lots of other people who won't need to debug why Tomcat is dying
from lack of permgen. :)

Comment 4 Mark Thomas 2008-01-18 13:03:57 UTC
commons-pool 1.4 has been released with the required fixes.

It will be in 6.0.16 and should be in 5.5.26 if the votes come through in time.
Comment 5 Mark Thomas 2008-01-20 09:09:02 UTC
This has been committed to svn for 5.5.x and will be in 5.5.26 onwards.