Suggested fix for JDK-4724038 (Add unmap method to MappedByteBuffer)

Alan Bateman Alan.Bateman at
Wed Sep 9 12:44:53 UTC 2015

On 09/09/2015 13:41, David M. Lloyd wrote:
> If you have access to a Windows development environment, it seems to 
> me that you could help directly with the testing required to determine 
> a solution.
> I think my proposed remapping approach will work, but it is contingent 
> on testing the following on Windows:
> * Determine if it is possible to remap the pages previously mapped to 
> a file view without first unmapping them.  Preferably, the pages would 
> be remapped as inaccessible (equivalent to POSIX PROT_NONE).
> * Determine if such remapping releases the file to be deleted, or, if 
> not, determine if the previously mapped file view can be unmapped 
> without affecting the remapped pages.
> If the answer to both of these can be shown to be affirmative, then I 
> think there is a real viable solution which allows immediate release 
> of backing resources, with the address space being reclaimed by GC.
There are a few contributions from Microsoft on this mailing list and 
they might be able to jump in on this discussion. When we last explored 
the remapping approach (about 5 years ago) then we didn't find a way to 
do it atomically so we gave up. It's good to explore this again with 
fresh eyes.


More information about the core-libs-dev mailing list