tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Heinen <>
Subject memory leak warning "ThreadLocal with key of type [null]" in 6.0.29
Date Tue, 01 Feb 2011 16:10:01 GMT

I got following warning after stopping my context with Tomcat 6.0.29

01.02.2011 15:58:00 org.apache.catalina.loader.WebappClassLoader 
SCHWERWIEGEND: The web application [/myapp] created a ThreadLocal with 
key of type [null] (value [com.MyClass$1@7cef53]) and a value of type 
[] (value 
[]) but failed to remove it 
when the web application was stopped. This is very likely to create a 
memory leak.

I searched in this list and found some answers saying that these 
messages with "key of type [null]" are false positives.
This should have been fixed in 6.0.25 according to these posts and 
according the relase notes:
"Modify ThreadLocal memory leak detection to not report false positives 
and to simplify implementation. (markt/kkolinko) "

The corresponding lines in myClass are:
private static final ThreadLocal<URLCodec> sURLCodec = new 
ThreadLocal<URLCodec>() {
   protected URLCodec initialValue() {
     return new URLCodec();

Is this a false alarm or wrong usage?


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

View raw message