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
Demand 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!
==Basic concept== Demand paging only brings pages into memory when an executing process demands them. This is often referred to as [[lazy loading]], as only those pages demanded by the process are swapped from [[secondary storage]] to [[main memory]]. Contrast this to pure swapping, where all memory for a process is swapped from secondary storage to main memory when the process starts up or resumes execution. Commonly, to achieve this process a [[memory management unit]] is used. The memory management unit maps [[logical memory]] to [[physical memory]]. Entries in the memory management unit include a bit that indicates whether a page is valid or invalid. A valid page is one that currently resides in main memory. An invalid page is one that currently resides in secondary memory. When a process tries to access a page, the following steps are generally followed: * Attempt to access page. * If page is valid (in memory) then continue processing instruction as normal. * If page is invalid then a '''page-fault trap''' occurs. * Check if the memory reference is a valid reference to a location on secondary memory. If not, the process is terminated ('''illegal memory access'''). Otherwise, we have to '''page in''' the required page. * Schedule disk operation to read the desired page into main memory. * Restart the instruction that was interrupted by the operating system trap.
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)