1. create a file by calling File.createNewFile().
2. mark the file, File.deleteOnExit()
3. write something in the file, open it for reading using MappedByteBuffer mapping.
4. close everything, dereference the mapped buffer (that one cannot be directly closed)
5. Error -> depending on how fast you exit the program, the file will or will not be deleted.
I would expect the mapped buffer to be unmapped on shutdown and the file to be released.
Our usecase in netbeans IDE is:
the output window is memory mapped for reading, the output keeps the output tabs open until the user closes them or until he/she closes the whole IDE.
This is Windows only problem it seems to work correctly on other platforms.
2. mark the file, File.deleteOnExit()
3. write something in the file, open it for reading using MappedByteBuffer mapping.
4. close everything, dereference the mapped buffer (that one cannot be directly closed)
5. Error -> depending on how fast you exit the program, the file will or will not be deleted.
I would expect the mapped buffer to be unmapped on shutdown and the file to be released.
Our usecase in netbeans IDE is:
the output window is memory mapped for reading, the output keeps the output tabs open until the user closes them or until he/she closes the whole IDE.
This is Windows only problem it seems to work correctly on other platforms.
- relates to
-
JDK-4724038 (fs) Add unmap method to MappedByteBuffer
- Closed