Memory - Mapped Files
consider a sequential read of a file on disk using the standard system calls open(), read(), and write(). Each file access requires a system call and disk access. Alternatively, we can use the virtual memory technique discussed so far to treat file I/O as routine memory access. This approach, known as associated with the file. As we shall see, this can lead to significant performance increase when performing I/O.
Working Sets And Page Fault Rates
There is a direct relationship between the working set of a process and its page-fault rate. Typically, as shown in figure 9.20, the working set of a process changes over time as references to data and code sections move from one locality to another. Assuming there is sufficient memory to store the working set of a process (that is, the process is not thrashing), the page-fault rate of the process will transition between peaks and valley over time. This general behavior is shown in Figure 9.22.
A peak in the page fault rate occurs when we begin demand-paging a new locality. However, once the working set of this new locality is in memory, page-fault rate falls. When the process moves to a new working set, the new page-fault rate rises toward a peak once again, returning to a lower rate once start of one peak and the start of the next peak represents the transition from one working set to another.