commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [jira] Commented: (JELLY-148) Huge memory leak resulting from the use of ThreadLocal
Date Sun, 19 Sep 2004 06:17:37 GMT
The following comment has been added to this issue:

     Author: Hans Gilde
    Created: Sat, 18 Sep 2004 11:17 PM
ThreadLocal is working fine.

However, ThreadLocal uses a structure like WeakHashMap. The key to the map is the ThreadLocal
object (it might as well be the TagScript instance b/c there's one ThreadLocal per TagScript
instance). The value in the map is the Tag implementation.

The problem is that the value (the tag implementation) keeps a reference to the key. This
is because the Tag keeps a reference to the Script of its body, the body script keeps a reference
to its parent, the parent is the TagScript that's used as the key in the map.

So, once entered into the HashMap, the key and value stay forever.

Solving this problem necessitates a change in the way TagScripts and Tags work together and
is more complicated than I initially thought.
View this comment:

View the issue:

Here is an overview of the issue:
        Key: JELLY-148
    Summary: Huge memory leak resulting from the use of ThreadLocal
       Type: Bug

     Status: Unassigned
   Priority: Critical

    Project: jelly
             core / taglib.core

   Reporter: Hans Gilde

    Created: Sat, 18 Sep 2004 9:34 PM
    Updated: Sat, 18 Sep 2004 11:17 PM

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:

If you want more information on JIRA, or have a bug to report see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message