Week 8: Virtual Memory Flashcards
What is the basic principle behind virtual memory?
At any given time, only the code and data needed for the current instruction must be in physical memory.
How does the operating system handle references to virtual memory and not to physical memory?
By recognizing them and fetching the required data into memory.
What is logical address space?
The address space that a program assumes is available, mapped to physical memory during execution.
How large is the logical address space for a 32-bit processor?
4GB (2³² bytes).
What are pages and page frames?
Pages are blocks of memory in logical address space, and page frames are their counterparts in physical memory.
Why are pages and page frames the same size?
To simplify mapping between logical and physical memory.
What role does the memory management unit (MMU) play in address translation?
It intercepts logical addresses and maps them to physical addresses using a page table.
What is a page table?
A data structure that stores the mapping between page numbers and page frame numbers.
Why are multilevel page tables used?
To reduce the size of page tables for systems with large address spaces.
How does multilevel indexing work?
It splits the page table into layers, reducing the memory needed for storing the entire table.
What is a page fault?
An interrupt generated when a process accesses a page not currently in physical memory.
What is demand paging?
Loading a page into memory only when it is needed.
What is the goal of page replacement algorithms?
To decide which page to remove from memory to make space for a new page.
How does the optimal page replacement algorithm work?
It replaces the page that will not be used for the longest time in the future.
Why is the optimal algorithm impractical?
A: It requires knowledge of future memory references.