United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6558368 : (bf) MappedByteBuffer.release()/close() to release system resources

Details
Type:
Enhancement
Submit Date:
2007-05-16
Status:
Closed
Updated Date:
2015-11-27
Project Name:
JDK
Resolved Date:
2007-05-16
Component:
core-libs
OS:
solaris_8
Sub-Component:
java.nio
CPU:
x86
Priority:
P5
Resolution:
Duplicate
Affected Versions:
7
Fixed Versions:

Related Reports
Duplicate:
Duplicate:

Sub Tasks

Description
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.

                                    

Comments



Hardware and Software, Engineered to Work Together