You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Arto Huusko <ar...@logica.com> on 2008/03/04 11:32:44 UTC

DispatchData in ApplicationContext causes ClassLoader leak

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:

--> java.lang.ThreadGroup@0x2aa4b85608 (67 bytes)  (field threads:)
--> [Ljava.lang.Thread;@0x2aa674dda0 (272 bytes) (Element 21 of
[Ljava.lang.Thread;@0x2aa674dda0:)
--> java.lang.Thread@0x2aa6f4b418 (164 bytes) (field threadLocals:)
--> java.lang.ThreadLocal$ThreadLocalMap@0x2aa6f86d18 (32 bytes) (field table:)
--> [Ljava.lang.ThreadLocal$ThreadLocalMap$Entry;@0x2aa6f86d38 (528 bytes)
(Element 16 of [Ljava.lang.ThreadLocal$ThreadLocalMap$Entry;@0x2aa6f86d38:)
--> java.lang.ThreadLocal$ThreadLocalMap$Entry@0x2aa6f87408 (56 bytes)
(field value:)
--> org.apache.catalina.core.ApplicationContext$DispatchData@0x2aa6f87440
(40 bytes) (field this$0:)
--> org.apache.catalina.core.ApplicationContext@0x2aa6f87b88 (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
arto.huusko@logica.com
www.logica.fi


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: DispatchData in ApplicationContext causes ClassLoader leak

Posted by Remy Maucherat <re...@apache.org>.
On Tue, 2008-03-04 at 12:45 +0100, Remy Maucherat wrote:
> On Tue, 2008-03-04 at 12:32 +0200, Arto Huusko wrote:
> > The DispatchData subclass in org.apache.cataline.core.ApplicationContext
> > causes ClassLoader leak, when a web application is undeployed.
> 
> And so you feel your bug is important enough to spam about it ?

Although I am almost certain I did read about this earlier, there's no
matching bug report I can find, so my complaint was a mistake (although
this should be in a bug report, not a mailing list post).

Rémy



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: DispatchData in ApplicationContext causes ClassLoader leak

Posted by Jim Manico <ji...@manico.net>.
Remy,

I think it would serve you to review the proposed Apache code of conduct 
at http://wiki.apache.org/incubator/CodeOfConduct

*Motto*

	

*Core Value*

* Put community before code. *

	

* collaboration *

Let they that do the work make the decisions.

	

self-determination

If it didn't happen on a mailing list, it didn't happen.

	

transparency

Merit never expires.

	

sustained interest

Critique our code, not our coders.

	

netiquette


Thank you,
- Jim

> On Tue, 2008-03-04 at 12:32 +0200, Arto Huusko wrote:
>   
>> The DispatchData subclass in org.apache.cataline.core.ApplicationContext
>> causes ClassLoader leak, when a web application is undeployed.
>>     
> /*
> And so you feel your bug is important enough to spam about it ?*/
>
> Rémy
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>   


Re: DispatchData in ApplicationContext causes ClassLoader leak

Posted by Remy Maucherat <re...@apache.org>.
On Tue, 2008-03-04 at 12:32 +0200, Arto Huusko wrote:
> The DispatchData subclass in org.apache.cataline.core.ApplicationContext
> causes ClassLoader leak, when a web application is undeployed.

And so you feel your bug is important enough to spam about it ?

Rémy



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org