commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guido Anzuoni" <guido.anzu...@kyneste.com>
Subject [Jelly] compiling scripts causes memory leaks
Date Fri, 17 Sep 2004 09:58:43 GMT
Hi all,
I have experienced the same pb running Jelly with Tomcat.
The problem seems to be caused by ThreadLocal in TagScript, here declared
as private, non-static member.
Unfortunately, XMLParser creates a new TagScript in its startElement.
This means that every time a script is run you will end-up with a TagScript instance
that is never finalized.
Just for test purposes I have commented ThreadLocal usage and no OutOfMemory occurs
anymore.
Well, I did not dig too deep in the code but, maybe, managing thread-safety 
with a ThreadLocal solution at this level is not the best approach.
More, I would suggest some refactoring to clearly separate responsibilities for
context management (i.e. variable resolution), script source management 
(i.e. templates reading) and script compilation.

Guido.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message