The DispatchData subclass in org.apache.cataline.core.ApplicationContext
causes ClassLoader leak, when a web application is undeployed.

When a URI belonging to the web application is accessed, a reference to
the ApplicationContext object is made through the DispatchData instance,
and the DispatchData instance is stored in a ThreadLocal variable.
Because DispatchData is not static inner class, it causes a reference
to the ApplicationContext object (which through a few steps causes
reference to the ClassLoader).

The path to ApplicationContext is (from jhat output) for example:

--> [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)


Please consider making DispatchData a static inner class, so that
reference to ApplicationContext will not hang around.

I'm also puzzled why dispatchData field in ApplicationContext is not
static?

-- 
Arto Huusko
_____________________________
Logica

Ruukinkatu 2-4, 20540 Turku, Finland
[EMAIL PROTECTED]
www.logica.fi


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to