Commons Digester
  1. Commons Digester
  2. DIGESTER-125

Memory leak in Digester class by inputSources collection

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8.1
    • Labels:
      None

      Description

      There is no clean method for inputSources list from Digeste class,
      in frequent usage of parse() method inputSources collection will collect references to sources objects. In this situation the number of object references represented by sources from inputSources,
      will be increased and consume a lot of memory. For intensive parsing smth around 200 mb for 8 hours was consumed.
      Solution is simple method cleanup() should contain line inputSources.clear(); at the end of the method.

        Activity

        Hide
        Simon Kitching added a comment -

        Thanks for pointing this out. The cleanup method has been modified to now clear the inputSources list (svn commit r665710).

        Note, however, that reusing a Digester instance is not recommended. See the wiki FAQ:
        http://wiki.apache.org/commons/Digester/FAQ

        I'll add some info about that to the Digester class javadocs.

        Show
        Simon Kitching added a comment - Thanks for pointing this out. The cleanup method has been modified to now clear the inputSources list (svn commit r665710). Note, however, that reusing a Digester instance is not recommended. See the wiki FAQ: http://wiki.apache.org/commons/Digester/FAQ I'll add some info about that to the Digester class javadocs.

          People

          • Assignee:
            Unassigned
            Reporter:
            Andrey Polyakov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development