I have an assignment for my Operating System course. One of the questions aks me to provide an explanation as to why it is possible/not possible to have 0 page-fault rate. Can a real system have enough RAM so that it will have no page faults at all.

I was thinking that maybe if we had an infinite amount of RAM, there will be no need for virtual memory, thus there will be no page-faults. I came to this cinclusion because page-faults happen when a process requests a memory page that is in virtual memory, and not in physical memory. Maybe with an infinite amount of RAM, all the memory the process will need will be on the physical memory, there will be no need for paging.

1 Answers

Joshua On

Yes, you can. There are times when we do not tolerate page faults, when any page fault is doomed. For starters, interrupt handlers may not page fault because they may not wait.

Besides that, sometimes the specification reads "must respond in 1/60th of a second" where the consequence of not responding is bad things happen. Depending on the severity of the consequences, we may go way out of our way to ensure page faults do not happen once initialized.

Yes, this means having enough RAM, but that alone will not suffice. There are system calls for locking pages into RAM so that they cannot ever be evicted because otherwise the OS would reclaim idle RAM in favor of disk cache. When we can't tolerate that behavior ...

Some embedded operating systems can't even page.