You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
D'oh, thanks for finding this @mjmckp . :( I'm rather surprised that the System.IO.BinaryReader dispose does not call dispose on the stream. My expectation, which may be wrong, is that if something implements IDisposable that any objects it "owns" that are also IDisposable should be likewise disposed. But, possibly my expectations are incorrect.
I suggest we use belt and suspenders approach. Even with proper Dispose() code, if the process is killed due to timeout, error, or user action, the file will remain. There exists a DeleteOnClose option that instructs the OS to delete this file even in the process is suddenly killed without disposers running their course.
Suggest we update the IFileHandle.cs to do something like this:
The
HybridMemoryStream
created in theTransposer
machinelearning/src/Microsoft.ML.Data/DataView/Transposer.cs
Line 173 in c023727
is closed, but never disposed. This is because the
Dispose
implementation of theBinaryLoader
heremachinelearning/src/Microsoft.ML.Data/DataLoadSave/Binary/BinaryLoader.cs
Line 1184 in c023727
only calls
Dispose
on theSystem.IO.BinaryReader
it contains, which in turn only callsClose
onHybridMemoryStream
, but notDispose
(see https://referencesource.microsoft.com/#mscorlib/system/io/binaryreader.cs,91). Therefore, the deletion of the temporary file heremachinelearning/src/Microsoft.ML.Core/Utilities/HybridMemoryStream.cs
Line 127 in c023727
is never reached.
This is causing the temporary directory on my PC to fill up all the available space on the disk.
The text was updated successfully, but these errors were encountered: