On Windows, in samevm mode, the cleanup of files in the scratch directory may fail because the files are still open.
Closing of FileInputStream and FileOutputStreams (that are not closed explicitly) are handled by either finalization or the Cleaner. Both are dependent on the running of System.gc().
Invoking System.gc as part of the cleanup will close streams and allow the files to be deleted.
Closing of FileInputStream and FileOutputStreams (that are not closed explicitly) are handled by either finalization or the Cleaner. Both are dependent on the running of System.gc().
Invoking System.gc as part of the cleanup will close streams and allow the files to be deleted.
- relates to
-
JDK-8080225 FileInput/OutputStream/FileChannel cleanup should be improved
- Resolved