Operating Systems · Unit 8
Virtual Memory and Paging
Exam-focused notes for Virtual Memory and Paging (Operating Systems, BIT204): what the TU syllabus asks and how it has actually been tested, with 6 solved past questions from this unit.
What this unit covers
- Page fault definition and occurrence
- FIFO page replacement algorithm
- Second Chance page replacement algorithm
- Optimal page replacement algorithm
- LRU page replacement algorithm
- Translation Lookaside Buffer
- TLB importance in address conversion
Page fault definition and occurrence
When does page fault occur?Given the 7 page reference strings 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 3, find the number of page fault using Optimal Page Replacement, FIFO and Second Chance Replacement algorithm. Assume the size of page frame is 4.[1+9]
A page fault occurs when a process references a page that is not currently present in main memory (RAM). The CPU generates a trap, and the OS must bring the required page from secondary storage into a frame. If no free frame exists, a page replacement algor...
Full solved answer →What is page fault? Consider the following page reference string, 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1. How many page faults would occur for each of the following page replacement algorithms assuming 3 frames? a. FIFO b. Second Chance c. LRU[10]
A page fault occurs when a process references a page that is not currently present in main memory (RAM). The OS traps the fault, locates the page on disk, finds a free frame (or evicts a page via a replacement algorithm), loads the page, updates the page ta...
Full solved answer →Translation Lookaside Buffer
Why virtual memory technique is used in the computer system? What is logical address? Explain the process of conversion of logical address to physical address using TLB.[10]
--- Virtual memory is a memory management technique that allows a computer to execute programs that are larger than the available physical memory (RAM). It creates an illusion of a very large memory space for each process by using a portion of the secondary...
Full solved answer →What is TLB? Explain the importance of TLB in conversion of logical address to physical address. [5]
A Translation Lookaside Buffer (TLB) is a small, fast hardware cache (associative memory) that stores recently used page table entries. It acts as a high-speed lookup table used by the Memory Management Unit (MMU) to speed up the translation of logical (vir...
Full solved answer →Optimal page replacement algorithm
Why Optimal Page Replacement is best but not practically feasible page replacement algorithm? Calculate the number of page faults for Optimal, LRU and FIFO replacement algorithm for the reference string: 1, 3, 4, 2, 3, 5, 4, 3, 1, 2, 4, 6, 3, 2, 1, 4, 2 using 3 page frames.[10]
Best: The Optimal (OPT / Belady's) algorithm replaces the page that will not be used for the longest time in the future. This produces the minimum possible number of page faults for any reference string and frame count. It is the theoretical lower bound aga...
Full solved answer →Consider the following page reference string: 3,2,1,3,4,2,8,9,7,4,2,9,8,3. Calculate the total number of page faults for Optimal and LRU page replacement algorithms using a 4 page frame. [5]
- Reference string: 3, 2, 1, 3, 4, 2, 8, 9, 7, 4, 2, 9, 8, 3 (14 references) - Frames = 4 --- Replace the page whose next use is furthest in the future. Step Page Frames after the reference Fault? Replacement reasoning --------------------------------------...
Full solved answer →Make Unit 8 stick
Practice BIT204 with flashcards & quizzes