commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Libbrecht (JIRA)" <commons-...@jakarta.apache.org>
Subject [jira] Updated: (JELLY-148) Huge memory leak resulting from the use of ThreadLocal
Date Thu, 16 Dec 2004 23:30:25 GMT
     [ http://nagoya.apache.org/jira/browse/JELLY-148?page=history ]

Paul Libbrecht updated JELLY-148:
---------------------------------

    Attachment: TagScript.java

This is a simplistic approach towards the notion of "run-session". Namely... it's using static
ThreadLocal instead of instance-based.
The ThreadLocal's content is a map whose keys are the script objects.
(and disabling the WeakReference)
The ThreadLocal's content is expected to be cleared at the complete end of a run but I didn't
find the exact place yet for this (in JellyContext.run()?).
The method to clear is called clearTagHolderMap() and is public static which makes it that
every one should be able to call it, even, say, in a finally or such.
Unit tests and my basic usage both work.

It would be interesting to see how other's would get it working.
I thought we had a good test for this but I didn't find it.

paul

> Huge memory leak resulting from the use of ThreadLocal
> ------------------------------------------------------
>
>          Key: JELLY-148
>          URL: http://nagoya.apache.org/jira/browse/JELLY-148
>      Project: jelly
>         Type: Bug
>   Components: core / taglib.core
>     Versions: 1.0
>     Reporter: Hans Gilde
>     Priority: Critical
>      Fix For: 1.0
>  Attachments: TagScript.java, jelly-nothreadlocal.ZIP, jelly-nothreadlocal2.ZIP, memory-leak-junit-test.txt,
thread-local-memory-leak-fix-demo-parent.txt, thread-local-memory-leak-fix-demo.txt, thread-local-memory-leak-fix-final-1.txt,
thread-local-memory-leak-fix-final-xml-tags.txt, thread-local-memory-leak-fix-final.txt, thread-local-memory-leak-profile.zip,
thread-local-memory-leak.zip
>
> There is a huge memory leak that results from the TagScript's use of ThreadLocal.
> ThreadLocal is usually used from a staic variable, while TagScript uses it from an instance
variable. Although this looks legal to me, it causes a huge memory leak.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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


Mime
View raw message