Uploaded image for project: 'ODF Toolkit'
  1. ODF Toolkit
  2. ODFTOOLKIT-300

Memory Leak in ODF Simple API

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.5-incubating
    • Fix Version/s: 0.6.2-incubating
    • Component/s: simple api
    • Labels:
      None
    • Environment:
      odfdom-java-0.8.7.jar; simple-odf-0.6.6.jar

      Description

      There is a memory leak in the ODF Simple API. I tried both, versions 0.6.6 and 0.6.5. It appears when running code like the examples on cookbook page

      http://incubator.apache.org/odftoolkit/simple/document/cookbook/Manipulate%20TextSearch.html

      In short, the call TextNavigation.nextSelection() leads to the leak. When you look down the method's call stack, you will find that items are added to the static variable "repository" of the static inner class "Selection.SelectionManager". The added items are never removed from the repository. One indication is that the method Selection.SelectionManager.unregisterItem() is never called.

      The code works fine if text navigation is done with few documents. But when its run on a server thousands of times, it will fill the JVMs memory.

        Attachments

        1. MemoryLeak_300.java
          2 kB
          Biao Han
        2. TestTextSelection.odt
          13 kB
          Biao Han

          Activity

            People

            • Assignee:
              svanteschubert Svante Schubert
              Reporter:
              silbermann Mathias Silbermann
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: