Memory Management, Paging and Virtual Memory Short Notes for Gate Cs
Memory Management, Paging and Virtual Memory short notes for GATE CS: 6 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practic
Memory Management Paging and Virtual Memory short notes
Formula Matrix
Formula Matrix
VA Pages = 2VA/2offset
Condition: byte-addressable, uniform page size
PT Size = VA Pages×PTE
Condition: single-level, contiguous allocation
Levels = ⌈(VA−offset)/index⌉
Condition: each level fits in one page frame
TLB Reach = Entries×Page
Condition: uniform page size, no huge pages
EAT (1-level) = h(t+m)+(1−h)(t+2m)
Condition: TLB and memory accesses sequential
EAT (n-level) = h(t+m)+(1−h)(t+(n+1)m)
Condition: no TLB multi-level lookup optimization
Trigger Table
If You See This, Do This
"32-bit logical, 20-bit physical"
Use 32-bit for PT entries. 20-bit is a distractor for PT size.
"Multi-level tree-structured"
Calculate entries per frame: 4096/PTE. Derive index bits: log2(entries).
"TLB hit ratio h, memory time m"
Apply EAT formula. Do not add PT access on a hit.
"Scattered virtual pages"
Assume 1 second-level page per accessed virtual page. Add ⌈pages/entries⌉ for first-level.
"Inverted Page Table"
Size = Physical Frames×IPT Entry Size. Ignore VA width for total rows.
"Huge page valid bit set"
Bypass lower-level tables. Concatenate remaining VA bits directly to frame number.
Traps and Invariants
Traps and Invariants
Trap: Using physical address width for PT entries
PT must map all possible virtual pages, regardless of physical limits.
Check: Always use VA width to calculate total entries.
Trap: Assuming multi-level PT always saves memory
Scattered access across all second-level tables negates the benefit.
Check: If scattered, overhead equals or exceeds single-level.
Trap: Adding PT access time on a TLB hit
TLB hit explicitly bypasses main memory PT lookup.
Check: Hit cost is strictly t+m. Miss is t+(n+1)m.
Invariant: Page table levels fit in one frame
Architecture constraint prevents spanning multiple frames per level.
Check: Index bits=log2(Page Size/PTE Size).
3 more cards in this chapter
Try a question
Answer it here to see how it works. Nothing is recorded until you sign in.
Question 1
Level 1: Warm-up
Assertion (A): A program with 15 memory accesses and 9 page faults has a page fault rate of 0.6.
Reason (R): Page fault rate is calculated as Total Page Faults divided by Total Memory Accesses.
Options:
A) Both A and R are true and R is the correct explanation of A
B) Both A and R are true but R is not the correct explanation of A
C) A is true but R is false
D) A is false but R is true
Question 2
Level 1: Warm-up
Assertion (A): In the LRU worked example with reference string [7, 2, 7, 3, 2, 5, 3, 4, 6, 7, 7, 1, 5, 6, 1] and 4 page frames, there are 9 page faults.
Reason (R): The page fault rate is calculated as Total Page Faults divided by Total Memory Accesses.
Options:
A) Both A and R are true and R is the correct explanation of A
B) Both A and R are true but R is not the correct explanation of A
C) A is true but R is false
D) A is false but R is true
Question 3
Level 1: Warm-up
A system uses a page size of 4 KB. A process accesses virtual address 8196 (in decimal). The page table maps this virtual page to physical frame number 5. The corresponding physical address in decimal is
Question 4
Level 1: Warm-up
Assertion (A): In a two-level page table with a 32-bit virtual address, 4 KB page size, and 4-byte page table entries, the outer page table index is 10 bits and the inner page table index is 10 bits. Reason (R): Each page table must fit exactly in one 4 KB page, and since each entry is 4 bytes, a page can hold 1024 entries, requiring 10 bits for each index.
Question 5
Level 1: Warm-up
Consider the following statements about the Least Recently Used (LRU) page replacement algorithm:
S1: LRU is a stack algorithm.
S2: LRU can exhibit Belady's anomaly.
S3: LRU requires hardware support to track usage history.
Which of the statements is/are true?
Options:
A) S1 only
B) S1 and S3 only
C) S2 and S3 only
D) S1, S2, and S3
Question 6
Level 1: Warm-up
Consider the following statements about manually tracing the Least Recently Used (LRU) page replacement algorithm:
S1: To find the victim page, you look backward in the reference string from the current position.
S2: On a hit, the accessed page is moved to the most recently used position.
S3: The page whose last occurrence is furthest back in the reference string is the LRU victim.
Which of the statements is/are true?
Options:
A) S1 only
B) S1 and S2 only
C) S2 and S3 only
D) S1, S2, and S3
Question 7
Level 1: Warm-up
Consider a system with a 32-bit virtual address space, a 20-bit physical address space, and a page size of 4 KB. Each page table entry is 4 bytes. Which of the following statements about the single-level page table is/are TRUE?
Question 8
Level 1: Warm-up
Consider the following statements about single-level page table size: S1: It depends on the virtual address space size. S2: It depends on the physical address space size. S3: It depends on the page size. S4: It depends on the page table entry size.
Which of the above statements is/are TRUE?
Question 9
Level 1: Warm-up
A system uses a 32-bit virtual address space and a page size of 4 KB. The single-level page table must be capable of mapping every possible virtual page. The number of entries required in this page table is
Question 10
Level 1: Warm-up
In the anchor scenario (32-bit virtual address, 20-bit physical address, 4 KB page size, 4-byte page table entries), the single-level page table is deliberately sized to expose the threshold where multi-level paging becomes mandatory. The size of this page table is
Free preview ends here
Login to view the complete short notes
Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.
Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.
Built around you, not around a syllabus PDF
Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.
Revision that hits your weak spots
We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.
Questions calibrated to the real exam
Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.
Notes written for recall, not for volume
Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.
One place for everything
Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.
Honest progress
No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.
Unlock the whole course
Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.
Memory Management, Paging and Virtual Memory Short Notes for GATE CS
Memory Management, Paging and Virtual Memory short notes for GATE CS: 6 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.
Formula Matrix
Formula Matrix
VA Pages = 2VA/2offset
Condition: byte-addressable, uniform page size
PT Size = VA Pages×PTE
Condition: single-level, contiguous allocation
Levels = ⌈(VA−offset)/index⌉
Condition: each level fits in one page frame
TLB Reach = Entries×Page
Condition: uniform page size, no huge pages
EAT (1-level) = h(t+m)+(1−h)(t+2m)
Condition: TLB and memory accesses sequential
EAT (n-level) = h(t+m)+(1−h)(t+(n+1)m)
Condition: no TLB multi-level lookup optimization
Trigger Table
If You See This, Do This
"32-bit logical, 20-bit physical"
Use 32-bit for PT entries. 20-bit is a distractor for PT size.
"Multi-level tree-structured"
Calculate entries per frame: 4096/PTE. Derive index bits: log2(entries).
"TLB hit ratio h, memory time m"
Apply EAT formula. Do not add PT access on a hit.
"Scattered virtual pages"
Assume 1 second-level page per accessed virtual page. Add ⌈pages/entries⌉ for first-level.
"Inverted Page Table"
Size = Physical Frames×IPT Entry Size. Ignore VA width for total rows.
"Huge page valid bit set"
Bypass lower-level tables. Concatenate remaining VA bits directly to frame number.
Traps and Invariants
Traps and Invariants
Trap: Using physical address width for PT entries
PT must map all possible virtual pages, regardless of physical limits.
Check: Always use VA width to calculate total entries.
Trap: Assuming multi-level PT always saves memory
Scattered access across all second-level tables negates the benefit.
Check: If scattered, overhead equals or exceeds single-level.
Trap: Adding PT access time on a TLB hit
TLB hit explicitly bypasses main memory PT lookup.
Check: Hit cost is strictly t+m. Miss is t+(n+1)m.
Invariant: Page table levels fit in one frame
Architecture constraint prevents spanning multiple frames per level.
Check: Index bits=log2(Page Size/PTE Size).
Recall Check
Recall Check (Tap to Reveal)
Memory Management, Paging and Virtual Memory: Solved Questions with Step-by-Step Explanations (10 Problems)
Question 1 · Operating SystemMCQ
Assertion (A): A program with 15 memory accesses and 9 page faults has a page fault rate of 0.6.
Reason (R): Page fault rate is calculated as Total Page Faults divided by Total Memory Accesses.
Options:
A) Both A and R are true and R is the correct explanation of A
B) Both A and R are true but R is not the correct explanation of A
C) A is true but R is false
D) A is false but R is true
A.
Both A and R are true and R is the correct explanation of A
B.
Both A and R are true but R is not the correct explanation of A
C.
A is true but R is false
D.
D) A is false but R is true
Correct Answer:
A
Step-by-Step Solution
Key idea: Verify both the assertion and reason, then check if the reason correctly explains the assertion.
Step 1: Evaluate Assertion (A). Page fault rate = 9 / 15 = 0.6. The assertion is true.
Step 2: Evaluate Reason (R). The formula for page fault rate is indeed Total Page Faults / Total Memory Accesses. The reason is true.
Step 3: Check if R explains A. The reason provides the exact formula used to calculate the value in the assertion. Therefore, R is the correct explanation of A.
Answer: Both A and R are true and R is the correct explanation of A (Option A)
Question 2 · Operating SystemMCQ
Assertion (A): In the LRU worked example with reference string [7, 2, 7, 3, 2, 5, 3, 4, 6, 7, 7, 1, 5, 6, 1] and 4 page frames, there are 9 page faults.
Reason (R): The page fault rate is calculated as Total Page Faults divided by Total Memory Accesses.
Options:
A) Both A and R are true and R is the correct explanation of A
B) Both A and R are true but R is not the correct explanation of A
C) A is true but R is false
D) A is false but R is true
A.
Both A and R are true and R is the correct explanation of A
B.
Both A and R are true but R is not the correct explanation of A
C.
A is true but R is false
D.
A is false but R is true
Correct Answer:
B
Step-by-Step Solution
Key idea: Verify both the assertion and reason, then check if the reason explains the assertion.
Step 1: Evaluate Assertion (A). The worked example traces LRU with the given reference string and 4 frames, resulting in 9 page faults out of 15 accesses. The assertion is true.
Step 2: Evaluate Reason (R). The formula for page fault rate is indeed Total Page Faults / Total Memory Accesses. The reason is true.
Step 3: Check if R explains A. The reason provides the general formula for calculating page fault rate, but it doesn't explain WHY there are 9 faults in the specific trace. The number of faults depends on the LRU algorithm's behavior with that specific reference string, not just the formula.
Step 4: Therefore, both are true but R is not the correct explanation of A.
Answer: Both A and R are true but R is not the correct explanation of A (Option B)
Question 3 · Operating SystemNAT
A system uses a page size of 4 KB. A process accesses virtual address 8196 (in decimal). The page table maps this virtual page to physical frame number 5. The corresponding physical address in decimal is
Correct Answer:
20484
Step-by-Step Solution
Key idea: Physical address = (frame number × page size) + offset. The offset is the same in virtual and physical addresses.
Assertion (A): In a two-level page table with a 32-bit virtual address, 4 KB page size, and 4-byte page table entries, the outer page table index is 10 bits and the inner page table index is 10 bits. Reason (R): Each page table must fit exactly in one 4 KB page, and since each entry is 4 bytes, a page can hold 1024 entries, requiring 10 bits for each index.
A.
Both A and R are true and R is the correct explanation of A.
B.
Both A and R are true but R is NOT the correct explanation of A.
C.
A is true but R is false.
D.
A is false but R is true.
Correct Answer:
A
Step-by-Step Solution
Key idea: The index bits are determined by how many entries fit in a single page frame.
Step 4: The 20-bit page number is split into two 10-bit indices for the outer and inner tables. Assertion A is TRUE.
Step 5: R correctly explains why A is true.
Answer: Both A and R are true and R is the correct explanation of A.
Question 5 · Operating SystemMCQ
Consider the following statements about the Least Recently Used (LRU) page replacement algorithm:
S1: LRU is a stack algorithm.
S2: LRU can exhibit Belady's anomaly.
S3: LRU requires hardware support to track usage history.
Which of the statements is/are true?
Options:
A) S1 only
B) S1 and S3 only
C) S2 and S3 only
D) S1, S2, and S3
A.
S1 only
B.
S1 and S3 only
C.
S2 and S3 only
D.
S1, S2, and S3
Correct Answer:
B
Step-by-Step Solution
Key idea: LRU is a stack algorithm that approximates Optimal using past behavior and requires hardware support.
Step 1: Evaluate S1. LRU is a stack algorithm because the set of pages in memory with N frames is always a subset of pages in memory with N+1 frames. S1 is true.
Step 2: Evaluate S2. Stack algorithms (including LRU) are mathematically guaranteed to never exhibit Belady's anomaly. S2 is false.
Step 3: Evaluate S3. LRU requires hardware support (counters or a stack) to track the usage history of pages. S3 is true.
Step 4: Conclude that S1 and S3 are true.
Answer: S1 and S3 only (Option B)
Question 6 · Operating SystemMCQ
Consider the following statements about manually tracing the Least Recently Used (LRU) page replacement algorithm:
S1: To find the victim page, you look backward in the reference string from the current position.
S2: On a hit, the accessed page is moved to the most recently used position.
S3: The page whose last occurrence is furthest back in the reference string is the LRU victim.
Which of the statements is/are true?
Options:
A) S1 only
B) S1 and S2 only
C) S2 and S3 only
D) S1, S2, and S3
A.
S1 only
B.
S1 and S2 only
C.
S2 and S3 only
D.
S1, S2, and S3
Correct Answer:
D
Step-by-Step Solution
Key idea: The manual LRU trace method uses backward looking to find the least recently used page.
Step 1: Evaluate S1. The manual method involves looking backward in the reference string from the current position to find which page was used least recently. S1 is true.
Step 2: Evaluate S2. On a hit, the accessed page becomes the most recently used, so it's moved to the MRU position in the tracking list. S2 is true.
Step 3: Evaluate S3. The LRU victim is the page whose last occurrence is furthest back in the reference string (or has no prior occurrence). S3 is true.
Step 4: All three statements correctly describe the manual LRU tracing method.
Answer: S1, S2, and S3 (Option D)
Question 7 · Operating SystemMSQ
Consider a system with a 32-bit virtual address space, a 20-bit physical address space, and a page size of 4 KB. Each page table entry is 4 bytes. Which of the following statements about the single-level page table is/are TRUE?
A.
The page table requires exactly 220 entries.
B.
The page table size is 1 MB.
C.
If the physical address space is increased to 24 bits, the page table size remains unchanged.
D.
If the page size is increased to 8 KB, the page table size becomes 2 MB.
Correct Answer:
["A","C","D"]
Step-by-Step Solution
Key idea: Page table size depends on virtual address space and page size, not physical address space.
Step 4: Changing physical address space does not affect the number of virtual pages. Statement C is TRUE.
Step 5: If page size = 8 KB = 213, entries = 232/213=219. Size = 219×4=221 bytes = 2 MB. Statement D is TRUE.
Answer: A, C, D
Question 8 · Operating SystemMSQ
Consider the following statements about single-level page table size: S1: It depends on the virtual address space size. S2: It depends on the physical address space size. S3: It depends on the page size. S4: It depends on the page table entry size.
Which of the above statements is/are TRUE?
Step 1: S1 is TRUE. VA space determines number of virtual pages.
Step 2: S2 is FALSE. Physical address space does not affect page table size.
Step 3: S3 is TRUE. Page size determines how many pages fit in VA space.
Step 4: S4 is TRUE. PTE size determines bytes per entry.
Step 5: True statements: S1, S3, S4.
Answer: S1, S3, and S4 only
Question 9 · Operating SystemMCQ
A system uses a 32-bit virtual address space and a page size of 4 KB. The single-level page table must be capable of mapping every possible virtual page. The number of entries required in this page table is
A.
28
B.
212
C.
220
D.
232
Correct Answer:
C
Step-by-Step Solution
Key idea: The number of page table entries is determined entirely by the virtual address space, not the physical memory.
Step 1: Virtual address space = 232 bytes.
Step 2: Page size = 4 KB = 212 bytes.
Step 3: Number of virtual pages = 232/212=220.
Step 4: Each virtual page needs exactly one page table entry, so the page table has 220 entries.
Answer: 220
Question 10 · Operating SystemMCQ
In the anchor scenario (32-bit virtual address, 20-bit physical address, 4 KB page size, 4-byte page table entries), the single-level page table is deliberately sized to expose the threshold where multi-level paging becomes mandatory. The size of this page table is
A.
1 MB
B.
4 MB
C.
16 MB
D.
256 KB
Correct Answer:
B
Step-by-Step Solution
Key idea: Page table size depends on virtual address space, not physical address space.