cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph Goers (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COCOON-1574) Memory Leak with XMLFileModule
Date Sat, 06 May 2006 05:44:43 GMT
    [ http://issues.apache.org/jira/browse/COCOON-1574?page=comments#action_12378194 ] 

Ralph Goers commented on COCOON-1574:
-------------------------------------

Possibly, but the caching is only one of the problems that needs to be addressed.  Other issues
include that document retrieval is done via a synchronized method (I'm still unclear as to
why) and that the configured file needs to resolved using the PreparedVariableResolver.  Basically,
I plan on dumping the whole DocumentHelper object as it is tied to a fixed document, which
is not at all useful for what I need. Furthermore, the code currently caches the DocumentHelper
object. I plan on putting the document itself in the store, which seems much more appropriate.
 

> Memory Leak with XMLFileModule
> ------------------------------
>
>          Key: COCOON-1574
>          URL: http://issues.apache.org/jira/browse/COCOON-1574
>      Project: Cocoon
>         Type: Bug

>   Components: * Cocoon Core
>     Versions: 2.2-dev (Current SVN)
>  Environment: Operating System: Windows XP
> Platform: PC
>     Reporter: Ron Blaschke
>     Assignee: Ralph Goers

>
> I'm currently looking into a memory leak issue at Apache Forrest.  Forrest's
> site currently needs to be built with -Xmx128m because of this.  I believe the
> issue is originated at Cocoon's LinkRewriterTransformer or XMLFileModule.
> A memory profiler shows lots (30MB+) of DOM DocumentImpls (150+ objects), which
> get referenced by XMLFileModule.DocumentHelper.  Their URIs are linkmap-xxx.
> LinkRewriterTransformer#createTransformedLink(String) uses a InputModuleHelper,
> which seems to reference a XMLFileModule.
>   ...
>   newLink = (String) modHelper.getAttribute(this.objectModel,
>                      ^^^^^^^^^
>   ...
> The XMLFileModule keeps the visited documents in a map, which is where they
> build up.
> Just for testing, I changed XMLFileModule#getDocumentHelper(Configuration) from
>   this.documents.put(src, new DocumentHelper(reload, cache, src, this));
> to
>   return new DocumentHelper(reload, cache, src, this);
> Thus, a new DocumentHelper is created every time, instead of caching them.  The
> result: No more memory problems, Apache Forrest's site builds again with -Xmx32.
> Ron

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message