OS & Hardware
Which describes demand paging?
- AAll pages are loaded into physical memory when a program starts
- BFrequently used pages are pinned permanently in the cache instead of on disk
- CA page fault occurs on a page's first use, and the page is loaded into physical memory then
Show answer and explanation
Answer: C. A page fault occurs on a page's first use, and the page is loaded into physical memory then
Under demand paging, starting a program only sets up page tables without loading actual pages. The first access to a page causes a page fault, and the OS loads just that page from disk. Startup is faster and no memory is spent on code or data that is never used. It is the opposite of loading everything up front and has nothing to do with pinning pages in the cache.
- A. It is the opposite of loading everything first.
- B. It has nothing to do with pinning data in the cache.
- C. Correct. Pages are loaded when they are needed.