tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Andreou" <andre...@gmail.com>
Subject Re: possible resource leak on war redeploy (tapestry 4.1)
Date Wed, 15 Oct 2008 04:15:15 GMT
Can you add this into Jira - it's possible to have the services that
instantiate
RegexpMatcher call a (new) close method on it whenever they're shutting down.

On Wed, Oct 15, 2008 at 4:28 AM, Pablo Gra~na <pablo.grana@globant.com> wrote:
> 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);
>
>        _pool.setMinEvictableIdleTimeMillis(EVICT_IDLE_TIME);
>        _pool.setTimeBetweenEvictionRunsMillis(SLEEP_TIME);
>    }
>
> (setMinEvictableIdleTimeMillis with a time different from -1 starts the
> eviction
> thread).
>
> 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
> Globant
> 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
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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


Mime
View raw message