RFR : 8221696: MappedByteBuffer.force method to specify range

Andrew Haley aph at redhat.com
Tue Apr 9 18:30:09 UTC 2019

On 4/9/19 11:42 AM, Andrew Dinn wrote:
> This new API method was conceived as a preliminary change for JEP 352 to
> allow selective writeback of NVRAM-backed buffers. However, it has been
> implemented to provide a similar capability for file-mapped byte
> buffers. The old brute-force API method, force(), continues to operate
> as before for file-mapped byte buffers.
> One detail that is worth highlighting is that for file-backed buffers
> the start address passed to the native method force0 is rounded down to
> a page boundary. This is needed for Unix implementations to ensure that
> the underlying msync system call does not throw an exception.

Is it actually necessary to use a system call to do this? I would have
thought that NVRAM allowed a finer granularity than a whole page, too.

Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

More information about the core-libs-dev mailing list