File Handle leak in RegionFileCache (MCP)
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.
Created Issue:
File Handle leak in RegionFileCache (MCP)
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.
Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.
No answer on querry, assuming not an issue anymore.
Just for the detail, the soft references are no longer used in the source of version 1.4.7. That is, this issue has been 'fixed'. No idea in which version.
Thanks for verifying.