https://issues.apache.org/bugzilla/show_bug.cgi?id=44389
--- Comment #1 from Arto Huusko <[EMAIL PROTECTED]> 2008-03-04 05:26:16 --- Caused by non-static inner class DispatchData in org.apache.cataline.core.ApplicationContext being held in a (non-static) ThreadLocal. While seemingly dispatchData is GC'able, Sun JVM Thread class holds reference to the ThreadLocal object through Thread class. Example path (from jhat): --> [EMAIL PROTECTED] (67 bytes) (field threads:) --> [Ljava.lang.Thread;@0x2aa674dda0 (272 bytes) (Element 21 of [Ljava.lang.Thread;@0x2aa674dda0:) --> [EMAIL PROTECTED] (164 bytes) (field threadLocals:) --> [EMAIL PROTECTED] (32 bytes) (field table:) --> [Ljava.lang.ThreadLocal$ThreadLocalMap$Entry;@0x2aa6f86d38 (528 bytes) (Element 16 of [Ljava.lang.ThreadLocal$ThreadLocalMap$Entry;@0x2aa6f86d38:) --> [EMAIL PROTECTED] (56 bytes) (field value:) --> [EMAIL PROTECTED] (40 bytes) (field this$0:) --> [EMAIL PROTECTED] (72 bytes) Because dispatchData field is non-static, what ever it contains is leaked when a particular ApplicationContext is discarded: a new ThreadLocal object is created for each ApplicationContext instance in each Thread, and when the instance is discarded, an unaccessible but still not GC'able reference stays in the JVM's Thread instances that used it. Because DispatchData inner class is not static, it also causes a reference to the ApplicationContext instance itself, which leads to catastrophic results, if the ClassLoader of the web app is referencable throught the ApplicationContext. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]