JDK-8202261 : (fc) FileChannel.map and RandomAccessFile.setLength should not preallocate space
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 8u181,9,10,11
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2018-04-25
  • Updated: 2019-05-13
  • Resolved: 2018-04-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 8
11 b12Fixed 8u202Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
This issue tracks reverting the changes in JDK-8168628 so that RandomAccessFile.setLength and the FileChannel.map do not call ftruncate64 to pre-allocate disk space. The background to this issue is that JDK-8168628 was mis-diagnosed, the real issue is that bulk transfer operations using Unsafe copyMemory lack memory guards. This requires changes in HotSpot and is tracked as JDK-8191278.

More discussion on this topic here:
http://mail.openjdk.java.net/pipermail/nio-dev/2018-April/005041.html