Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-17582

Resource leaks due to unclosed InputStreams

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 11.10.5
    • Fix Version/s: None
    • Component/s: Other
    • Labels:
      None
    • Difficulty:
      Unknown
    • Similar issues:

      Description

      We have many places in platform where we use an InputStream but forget to close it. This can lead to resource leaks (e.g. unreleased file descriptors) and other problems over the lifetime of a running XWiki instance.

      After going through the output of a simple grep (that excludes test):

      grep "getResourceAsStream" . -R --exclude-dir=target* --exclude-dir=test
      

      ...and filtering out the valid usages, I ended up with this relatively complete list of problems in xwiki-platform that need to be addressed and the used InputStreams need to be closed (generally by using try-with-catch in most cases):

      I got the idea to check this after watching this relevant part of this video: https://www.youtube.com/watch?v=c755fFv1Rnk&t=45m10s (even more details on the problem and how the memory grew in that example in the previous minutes).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              enygma Eduard Moraru
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Date of First Response: