Details

    • Type: Bug Bug
    • Status: Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2
    • Fix Version/s: 2.1.11
    • Component/s: * Cocoon Core
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC

      Description

      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

        Issue Links

          Activity

          Ronald Blaschke created issue -
          Jeff Turner made changes -
          Field Original Value New Value
          issue.field.bugzillaimportkey 36162 12324883
          Pier Fumagalli made changes -
          Workflow jira [ 12341318 ] Cocoon Workflow [ 12341451 ]
          Ralph Goers made changes -
          Component/s * Cocoon Core [ 12310442 ]
          Component/s Blocks: (Undefined) [ 12310440 ]
          Bugzilla Id 36162
          Description 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
          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
          Ross Gardler made changes -
          Link This issue is blocked by FOR-591 [ FOR-591 ]
          Ross Gardler made changes -
          Link This issue is blocked by FOR-591 [ FOR-591 ]
          Ross Gardler made changes -
          Link This issue blocks FOR-591 [ FOR-591 ]
          Jean-Baptiste Quenot made changes -
          Status Open [ 1 ] On Hold [ 10000 ]
          Jean-Baptiste Quenot made changes -
          Assignee Cocoon Developers Team [ cocoon ] Jean-Baptiste Quenot [ jbq ]
          Ralph Goers made changes -
          Assignee Jean-Baptiste Quenot [ jbq ] Ralph Goers [ ralph.goers@dslextreme.com ]
          Bugzilla Id 36162
          Jörg Heinicke made changes -
          Status On Hold [ 10000 ] Continued [ 10001 ]
          Ralph Goers made changes -
          Fix Version/s 2.1.11 [ 12312231 ]
          Status Continued [ 10001 ] Closed [ 6 ]
          Affects version (Component) Parent values: Components: Sitemap(10152).
          Fix version (Component) Parent values: Components: Sitemap(10229).
          Resolution Fixed [ 1 ]
          Jasha Joachimsthal made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]

            People

            • Assignee:
              Ralph Goers
              Reporter:
              Ronald Blaschke
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Development