You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by ant elder <an...@gmail.com> on 2010/10/24 08:48:39 UTC

Memory leak in CompositeContext

Tomcat 7's new memory leak detection is reporting a memory leak with
Tuscany webapps:

SEVERE: The web application [/helloworld-jsp] created a ThreadLocal
with key of type [java.lang.InheritableThreadLocal] (value
[java.lang.InheritableThreadLocal@13c2d7f]) and a value of type
[org.apache.tuscany.sca.context.CompositeContext] (value
[org.apache.tuscany.sca.context.CompositeContext@1cefde4]) but failed
to remove it when the web application was stopped. This is very likely
to create a memory leak.
23-Oct-2010 17:47:33 org.apache.catalina.loader.WebappClassLoader
clearThreadLocalMap

I had a look at the ThreadLocal in CompositeContext and couldn't see
anything that actually used it, taking it out all the references to it
and a full build completes fine so nothing does use it. Is there any
reason to keep it now?

   ...ant

Re: Memory leak in CompositeContext

Posted by ant elder <an...@gmail.com>.
Thanks for the helpful explanation Raymond. I'll go try a few more
distributed tests.

   ...ant

On Sun, Oct 24, 2010 at 6:35 PM, Raymond Feng <cy...@gmail.com> wrote:
> I have noticed that with Tomcat 6 shutdown too. The thread local was used to
> establish the context for deserilizaling remote Endpoints replicated into
> the EndpointRegistry. We improved it using a lazy deserialization from XML
> when the Endpoint is actually used (by the time, we should already have the
> ComponentContext on the thread).
> Can you do more tests based on the distributed EndpointRegistry cases so
> that we can remove it?
> Thanks,
> Raymond
> ________________________________________________________________
> Raymond Feng
> rfeng@apache.org
> Apache Tuscany PMC member and committer: tuscany.apache.org
> Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com
> Personal Web Site: www.enjoyjava.com
> ________________________________________________________________
> On Oct 23, 2010, at 11:48 PM, ant elder wrote:
>
> Tomcat 7's new memory leak detection is reporting a memory leak with
> Tuscany webapps:
>
> SEVERE: The web application [/helloworld-jsp] created a ThreadLocal
> with key of type [java.lang.InheritableThreadLocal] (value
> [java.lang.InheritableThreadLocal@13c2d7f]) and a value of type
> [org.apache.tuscany.sca.context.CompositeContext] (value
> [org.apache.tuscany.sca.context.CompositeContext@1cefde4]) but failed
> to remove it when the web application was stopped. This is very likely
> to create a memory leak.
> 23-Oct-2010 17:47:33 org.apache.catalina.loader.WebappClassLoader
> clearThreadLocalMap
>
> I had a look at the ThreadLocal in CompositeContext and couldn't see
> anything that actually used it, taking it out all the references to it
> and a full build completes fine so nothing does use it. Is there any
> reason to keep it now?
>
>   ...ant
>
>

Re: Memory leak in CompositeContext

Posted by Raymond Feng <cy...@gmail.com>.
I have noticed that with Tomcat 6 shutdown too. The thread local was used to establish the context for deserilizaling remote Endpoints replicated into the EndpointRegistry. We improved it using a lazy deserialization from XML when the Endpoint is actually used (by the time, we should already have the ComponentContext on the thread).

Can you do more tests based on the distributed EndpointRegistry cases so that we can remove it?

Thanks,
Raymond
________________________________________________________________ 
Raymond Feng
rfeng@apache.org
Apache Tuscany PMC member and committer: tuscany.apache.org
Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com
Personal Web Site: www.enjoyjava.com
________________________________________________________________

On Oct 23, 2010, at 11:48 PM, ant elder wrote:

> Tomcat 7's new memory leak detection is reporting a memory leak with
> Tuscany webapps:
> 
> SEVERE: The web application [/helloworld-jsp] created a ThreadLocal
> with key of type [java.lang.InheritableThreadLocal] (value
> [java.lang.InheritableThreadLocal@13c2d7f]) and a value of type
> [org.apache.tuscany.sca.context.CompositeContext] (value
> [org.apache.tuscany.sca.context.CompositeContext@1cefde4]) but failed
> to remove it when the web application was stopped. This is very likely
> to create a memory leak.
> 23-Oct-2010 17:47:33 org.apache.catalina.loader.WebappClassLoader
> clearThreadLocalMap
> 
> I had a look at the ThreadLocal in CompositeContext and couldn't see
> anything that actually used it, taking it out all the references to it
> and a full build completes fine so nothing does use it. Is there any
> reason to keep it now?
> 
>   ...ant