Advantages of Memory Mapped Files
- It increases the I/O performance especially when it is used on large files.
- Accessing memory mapped file is faster than using direct system calls like read() and write().
- Another advantage is lazy loading where small amount of RAM is used for a very large file.
- Shared memory is often implemented by memory mapping files. Thus, it supports data sharing.
Memory Mapped Files in OS
We can use standard system calls like read(), seek(), open(), and so on to perform a sequential read of a file present on the disk. Thus, to access a file from the disk we need system calls and disk access. Memory mapping is a technique that allows a part of the virtual address space to be associated with a file logically. This technique of memory mapping leads to a significant increase in performance.
Contact Us