A DESCRIPTION OF THE REQUEST :
The current JRE release does not support releasing of a java.nio.MappedByteBuffer.
Documentation says: "A mapped byte buffer and the file mapping that it represents remain valid until the buffer itself is garbage-collected."
Therefore it is not possible to delete the underlying file on Windows, if has been mmap'd before (and the MappedByteBuffer has not been GC'd).
JUSTIFICATION :
Let java.nio.MappedByteBuffer implement the interface java.io.Closeable
or
add a method release().
Either way should immediatly release all system resources referenced by the mapped byte buffer.
The current JRE release does not support releasing of a java.nio.MappedByteBuffer.
Documentation says: "A mapped byte buffer and the file mapping that it represents remain valid until the buffer itself is garbage-collected."
Therefore it is not possible to delete the underlying file on Windows, if has been mmap'd before (and the MappedByteBuffer has not been GC'd).
JUSTIFICATION :
Let java.nio.MappedByteBuffer implement the interface java.io.Closeable
or
add a method release().
Either way should immediatly release all system resources referenced by the mapped byte buffer.
- duplicates
-
JDK-8144174 Potential off-heap memory leak, while FileChannel.map
- Closed
-
JDK-4724038 (fs) Add unmap method to MappedByteBuffer
- Closed