In computer storage technology, a page fault is an interrupt (or exception) to the software raised by the hardware, when a program accesses a page that is not mapped in physical memory. The software that handles the page fault is generally part of an operating system and the hardware that detects this situation is the memory management unit in processors. Then an operating system can try to handle the page fault by making the required page accessible at a location in physical memory or kill the program in case it is an illegal access.
Situations when a page fault can happen:
Contrary to what its name might suggest, a page fault is not necessarily a fatal error. In any operating system that utilises virtual memory to increase the amount of memory available to programs, page faults are a common and necessary occurrence. The general protection fault, or the less common "invalid page fault," found on computers running a Microsoft Windows operating system, are actually generated by the exception handling code in the operating system's page fault handler. When a page fault occurs that would cause Windows to page in memory that the currently-running program does not have permissions to access, such as accessing memory that properly belongs to another process, the system will generate a "general protection fault." If a page fault occurs that references a non-existent memory page, such as trying to read a null pointer, the system may alternately generate an "invalid page fault." (Recent versions of Windows replace both these and other hardware-generated fault errors with a single, less technical error simply stating that "this program must close", but the underlying causes are the same). UNIX and UNIX-like operating systems will handle these conditions by delivering signals, such as SIGSEGV ("segmentation violation"), to the offending process. In all of these cases, the fatal error is ultimately the fault of poorly behaving software, and not of the hardware.
Page faults, by their very nature, degrade the performance of a program or operating system and in the degenerate case can cause thrashing. Optimizations to programs and the operating system that reduce the number of page faults that occur improves the program's or the entire system's performance. The two primary focuses of the optimization effort focus on reducing overall memory usage and improving memory locality. Generally, making more physical memory available also reduces page faults.
There are many page replacement algorithm are available which help us rectify page faults. Some of them are stated as follows: 1. Not Recently Used(NRU) 2. First in First Out (FIFO) 3. Clock Replacement algorithm 4. Least Recently Used(LRU)
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Page fault".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world