Memory mapping and file I/O
If i have memory mapped a file of size 10GB in a 1GB machine and if i trigger a file i/o, after makin开发者_运维技巧g sure that the data requested is not in physical memory, will the fetched data get mapped to the corresponding virtual address in mmap?
When i access the same location using mmap, will it again do an i/o (or will it make use of the data that was fetched using file i/o)
Thanks in advance,
Gokul.
It depends on the platform, but in general it'll be treated like other memory (swapped out when not in use, swapped in when required), except that instead of using the normal swap files/partitions it swaps from the original file on disk.
精彩评论