Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-1599

File Handle leak in RegionFileCache (MCP)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 1.4.2
    • Fix Version/s: Minecraft 1.4.6
    • Labels:
      None
    • Confirmation Status:
      Unconfirmed

      Description

      File handles can leak if the soft references in RegionFileCache(MCP) are garbage collected. This can lead to a slow decrease in performance and ultimately IO problems because file handles run out.

      https://github.com/cpw/FML/commit/6edce8b5f4d522f58421da4e00735cb6493103e6

      I fixed it by removing the soft reference. The other approach is to apply a finalizer, but that's considered bad form. Better to always control this manually.

      FYI the leak is the RandomAccessFile inside the RegionFile itself- note that there is no "finalizer cleanup" on RandomAccessFile.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cpw cpw
            • Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: