You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Jasha Joachimsthal (JIRA)" <ji...@apache.org> on 2010/06/30 09:42:50 UTC

[jira] Closed: (COCOON-2259) Memory leak in PoolableProxyHandler

     [ https://issues.apache.org/jira/browse/COCOON-2259?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jasha Joachimsthal closed COCOON-2259.
--------------------------------------

    Fix Version/s: 2.2-dev (Current SVN)
       Resolution: Fixed

Applied the patch. Thanks for submitting it.

> Memory leak in PoolableProxyHandler
> -----------------------------------
>
>                 Key: COCOON-2259
>                 URL: https://issues.apache.org/jira/browse/COCOON-2259
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.2, 2.2-dev (Current SVN)
>            Reporter: Alexander Daniel
>            Assignee: Jasha Joachimsthal
>             Fix For: 2.2-dev (Current SVN)
>
>         Attachments: patchForIssue2259.txt
>
>
> I reproduced the problem with following pipeline and by adding log output to PoolableProxyHandler [1]
> <map:pipeline id="cocoonTest" type="noncaching">
> 	<map:match pattern="cocoonProtocol">
> 		<map:generate src="cocoon://sub"/>
> 		<map:serialize type="xhtml"/>
> 	</map:match>
> 	<map:match pattern="sub">
> 		<map:generate src="welcome/welcome.xml"/>
> 		<map:transform src="welcome/welcome.xslt"/>
> 		<map:serialize type="xhtml"/>
> 	</map:match>
> </map:pipeline>
> Changing the line 
>      this.attributeName = PoolableProxyHandler.class.getName() + '/' + this.handler.hashCode();
> to
>      this.attributeName = PoolableProxyHandler.class.getName() + '/' + this.hashCode();
> fixes the memory leak.
> Why? The PoolableFactoryBean [2] handler is a singleton for every pipeline component, i.e. one instance for noncaching pipeline, one instance for xalan transformer, ... Therefore the attributeName is the same for every component of the same type but Spring requires an unique value for the destruction callback handler.
> In the example sitemap above two noncaching pipeline instances are needed for processing the request. Both call registerDestructionCallback with the same attributeName. Because the attributeName is the same the callback is only called once and the other component remains in ThreadLocal.
> [1] http://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/PoolableProxyHandler.java
> [2] http://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/PoolableFactoryBean.java

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


RE: [jira] Closed: (COCOON-2259) Memory leak in PoolableProxyHandler

Posted by Robby Pelssers <ro...@ciber.com>.
One question:

Yesterday I downloaded the sources from cocoon/tags/cocoon-2.2/cocoon-sitemap-impl/cocoon-sitemap/impl-1.0.0.  Next I made the necessary code change and installed the artifact in my local maven repo.

But this does not ensure unfortunately that my colleague(s) use the same patched artifact.  What would be the best way forward for me in this case since you only applied the patch to trunk which is a snapshot version.

Cheers,
Robby