Science Fair Project Encyclopedia
Mmap
In computing, mmap() is a POSIX compliant Unix system call that maps files or devices into memory.
In Linux, mmap() can create several types of mappings.
Anonymous mappings are mappings of physical RAM to virtual RAM. This is similar to malloc(), and is used in some malloc() implementations for certain allocations.
File backed mappings are mappings of files to virtual RAM. Access to those areas of RAM causes the file to be changed. Usually, the segment of the file mapped in is copied to RAM and periodically flushed to disk. If the mapping is shared, changes to that area in one process will affect other processes with that area mapped in immediately; otherwise, the changes will be asynchronous, and processes will not always have consistent views of that area.
mmaped memory is kept visible across a fork.
mmap is sometimes used for Interprocess Communication (IPC). On modern operating systems mmap is typically preferred to the System V IPC shared memory facility.
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details


