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
Memory paging
(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!
==Page faults== {{Main|Page fault}} When a process tries to reference a page not currently mapped to a [[page frame]] in RAM, the processor treats this invalid memory reference as a [[page fault]] and transfers control from the program to the operating system. The operating system must: # Determine whether a stolen page frame still contains an unmodified copy of the page; if so, use that page frame. # Otherwise, obtain an empty page frame in RAM to use as a container for the data, and: #* Determine whether the page was ever initialized #* If so determine the location of the data on secondary storage{{efn|name=secondary}}. #* Load the required data into the available page frame. # Update the [[page table]] to refer to the new page frame. # Return control to the program, transparently retrying the [[Instruction (computer science)|instruction]] that caused the page fault. When all page frames are in use, the operating system must select a page frame to reuse for the page the program now needs. If the evicted page frame was [[dynamic allocation|dynamically allocated]] by a program to hold data, or if a program modified it since it was read into RAM (in other words, if it has become "dirty"), it must be written out to secondary storage before being freed. If a program later references the evicted page, another page fault occurs and the page must be read back into RAM. The method the operating system uses to select the page frame to reuse, which is its [[page replacement algorithm]], affects efficiency. The operating system predicts the page frame least likely to be needed soon, often through the [[Page replacement algorithm#Least recently used|least recently used]] (LRU) algorithm or an algorithm based on the program's [[working set]]. To further increase responsiveness, paging systems may predict which pages will be needed soon, preemptively loading them into RAM before a program references them, and may steal page frames from pages that have been unreferenced for a long time, making them available. Some systems clear new pages to avoid data leaks that compromise security; some set them to installation defined or random values to aid debugging.
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)