]
Bela Ban updated JGRP-1500:
---------------------------
Fix Version/s: 3.0.12
ThreadLocal leak in FlowControl
-------------------------------
Key: JGRP-1500
URL:
https://issues.jboss.org/browse/JGRP-1500
Project: JGroups
Issue Type: Bug
Affects Versions: 2.12.3
Environment: Tomcat
Reporter: Elliot Lovy
Assignee: Bela Ban
Fix For: 3.0.12, 3.2
org.jgroups.protocols.FlowControl has a thread local leak.
Tomcat's memory management shows:
SEVERE: The web application [/app] created a ThreadLocal with key of type [null] (value
[org.jgroups.protocols.FlowControl$1@79c1187f]) and a value of type [java.lang.Boolean]
(value [false]) but failed to remove it when the web application was stopped. This is very
likely to create a memory leak.
The fix seems straightforward to me, just replace the two instances of:
ignore_thread.set(false);
with
ignore_thread.remove();
I have verified this does indeed prevent the leak.
Since false is the default value the thread local would get created with, then setting it
to false is equivalent to removing it, with the added benefit of actually removing the
ThreadLocal from the application server's thread.
So it only exists while it is set to true.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: