-
Bug
-
Resolution: Fixed
-
Minecraft 1.4.2
-
None
-
Unconfirmed
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.