Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Page fault
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Types == === Minor page fault === If the page is loaded in memory at the time the fault is generated, but is not marked in the [[memory management unit]] as being loaded in memory, then it is called a ''minor'' or ''soft'' page fault. The page fault handler in the [[operating system]] merely needs to make the entry for that page in the memory management unit point to the page in memory and indicate that the page is loaded in memory; it does not need to read the page into memory. This could happen if the [[Shared memory (interprocess communication)|memory is shared]] by different programs and the page is already brought into memory for other programs. === Major page fault === This is the mechanism used by an operating system to increase the amount of program memory available on demand. The operating system delays loading parts of the program from disk until the program attempts to use it and the page fault is generated. If the page is not loaded in memory at the time of the fault, then it is called a ''major'' or ''hard'' page fault. The page fault handler in the OS needs to find a free location: either a free page in memory, or a non-free page in memory. This latter might be used by another process, in which case the OS needs to write out the data in that page (if it has not been written out since it was last modified) and mark that page as not being loaded in memory in its process [[page table]]. Once the space has been made available, the OS can read the data for the new page into memory, add an entry to its location in the memory management unit, and indicate that the page is loaded. Thus major faults are more expensive than minor faults and add storage access latency to the interrupted program's execution. === Invalid page fault === If a page fault occurs for a reference to an address that is not part of the virtual [[address space]], meaning there cannot be a page in memory corresponding to it, then it is called an ''invalid'' page fault. The page fault handler in the operating system will then generally pass a [[segmentation fault]] to the offending process, indicating that the access was invalid; this usually results in [[abnormal termination]] of the code that made the invalid reference. A [[null pointer]] is usually represented as a pointer to address 0 in the address space; many operating systems set up the MMU to indicate that the page that contains that address is not in memory, and do not include that page in the virtual address space, so that attempts to read or write the memory referenced by a null pointer get an invalid page fault.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)