I'm reading a 50 gb file (read only) using multiple threads with each thread reading a sequential segment from the file. I tried two approaches
- Using a FileChannel
- Using a MemoryMappedBuffer obtained from a FileChannel
I was expecting the MemoryMappedBuffer to outperform the FileChannel but the FileChannel performs about 30% better consistently.
I'm looking for an explanation. I'm memory mapping in 1 gb at a time and once I run out I map another 1 gb.
My environment: Windows 7 platform 64 bit xeon 2.7 ghz 2 processors