tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pablo Gra\\~na" <pablo.gr...@globant.com>
Subject possible resource leak on war redeploy (tapestry 4.1)
Date Wed, 15 Oct 2008 01:28:49 GMT
Hi there. I think a found a resource leak in RegexpMatcher. It uses commons-pool
to cache the compiled regexps, with an eviction thread. The problem is that
nobody is calling close on the pool, so the eviction thread is always alive,
making the class loader not collectable. Here are the retade code fragments:

     public RegexpMatcher()
         _pool = new GenericKeyedObjectPool(_factory);


(setMinEvictableIdleTimeMillis with a time different from -1 starts the eviction

No call is ever made to _pool.close(), and _pool is private.

I don't know what is the correct solution for this. One thing I can think of is
making _pool static, and expose a static close method on RegexpMatcher so that
it can be called on context shut down (does tapestry have a hook called on
context shut down?)

thanks a lot.

Pablo Gra\~na
Chief Architect
Arg Office: +54 (11) 4109 1743
UK  Office: +44 (20) 7043 8269 int 8043
US  Office: +1 (212) 400 7686 int 8043

To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org

View raw message