This is very easy to explain:
In the first part you copy the whole memory mapped stuff into a on-heap byte
array. You allocate this byte array in total and you then do a copy (actually
this is a standard libc copy call) of the whole file. To do this copy, the
underlying OS will need to swap in
Your code isn't doing what you think it is doing. You need to ensure
things aren't eliminated by the compiler.
On Mon, Jul 14, 2014 at 5:57 AM, wangzhijiang999
wrote:
> Hi everybody, I found a problem confused me when I tested the mmap
> feature in lucene. I tested to read a file size of