As far as I see it, the MappedByteBuffer
, after a call to FileChannel.map
"maps" file content into memory, but not necessarily loading the whole file in. So, if I start reading e.g. at pos(0), a page might be actually loaded from disk at that time e.g. first 4096 bytes of the file, into the main memory (outside of Heap, as it is a direct memory buffer).
My question is - what happens if I call load()
method on the buffer? would that, at best effoert, try to map the ENTIRE file into memory e.g. exactly load 1GB of data, considering this is the amount I mapped?