Page Replacement questions

Q54

GATE CS 2025 CS-1Memory ManagementNAT2 marks
In optimal page replacement algorithm, information about all future page references is available to the operating system (OS). A modification of the optimal page replacement algorithm is as follows:
The OS correctly predicts only up to next 4 page references (including the current page) at the time of allocating a frame to a page.
A process accesses the pages in the following order of page numbers:
1, 3, 2, 4, 2, 3, 1, 2, 4, 3, 1, 4.
If the system has three memory frames that are initially empty, the number of page faults that will occur during execution of the process is ________ . (Answer in integer)
Show answer without attempting

Answer: 6

Q47

GATE CS 2025 CS-2Memory ManagementMSQ2 marks
Consider a demand paging system with three frames, and the following page reference string: 1  2  3  4  5  4  1  6  4  5  1  3  21 \; 2 \; 3 \; 4 \; 5 \; 4 \; 1 \; 6 \; 4 \; 5 \; 1 \; 3 \; 2. The contents of the frames are as follows initially and after each reference (from left to right), as shown in the table:

The *-marked references cause page replacements.

Which one or more of the following could be the page replacement policy/policies in use?
Question figure
More than one option can be correct.
Show answer without attempting

Answer: D

Q57

GATE CS 2023 CSMemory ManagementNAT2 marks
Consider the following two-dimensional array D in the C programming language, which is stored in row-major order:
int D[128][128];
Demand paging is used for allocating memory and each physical page frame holds 512 elements of the array D. The Least Recently Used (LRU) page-replacement policy is used by the operating system. A total of 30 physical page frames are allocated to a process which executes the following code snippet:
for (int i = 0; i < 128; i++)
  for (int j = 0; j < 128; j++)
    D[j][i] *= 10;
The number of page faults generated during the execution of this code snippet is ____________.
Show answer without attempting

Answer: 4096

Q64

GATE CS 2022 CSMemory ManagementNAT2 marks
Consider a demand paging system with four page frames (initially empty) and LRU page replacement policy. For the following page reference string

7,2,7,3,2,5,3,4,6,7,7,1,5,6,17, 2, 7, 3, 2, 5, 3, 4, 6, 7, 7, 1, 5, 6, 1

the page fault rate, defined as the ratio of number of page faults to the number of memory accesses (rounded off to one decimal place) is_________.
Show answer without attempting

Answer: 0.6

Q40

GATE CS 2017 CS-1Memory ManagementMCQ2 marks−2/3 if wrong
Recall that Belady's anomaly is that the page-fault rate may increase as the number of allocated frames increases. Now, consider the following statements:

S1: Random page replacement algorithm (where a page chosen at random is replaced) suffers from Belady's anomaly
S2: LRU page replacement algorithm suffers from Belady's anomaly

Which of the following is CORRECT?
Show answer without attempting

Answer: B

Q49

GATE CS 2016 CS-1Memory ManagementNAT2 marks
Consider a computer system with ten physical page frames. The system is provided with an access sequence (a1,a2,…,a20,a1,a2,…,a20)(a_1, a_2, \dots, a_{20}, a_1, a_2, \dots, a_{20}), where each aia_i is a distinct virtual page number. The difference in the number of page faults between the last-in-first-out page replacement policy and the optimal page replacement policy is ________.
Show answer without attempting

Answer: 1.0

Q20

GATE CS 2016 CS-2Memory ManagementMCQ1 mark−1/3 if wrong
In which one of the following page replacement algorithms it is possible for the page fault rate to increase even when the number of allocated frames increases?
Show answer without attempting

Answer: D

Q57

GATE CS 2015 CS-1Memory ManagementMCQ2 marks−2/3 if wrong
Consider a main memory with five page frames and the following sequence of page references: 3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3. Which one of the following is true with respect to page replacement policies First In First Out (FIFO) and Least Recently Used (LRU)?
Show answer without attempting

Answer: A

Q33

GATE CS 2014 CS-2Memory ManagementMCQ2 marks−2/3 if wrong
A computer has twenty physical page frames which contain pages numbered 101 through 120. Now a program accesses the pages numbered 1, 2, …, 100 in that order, and repeats the access sequence THRICE. Which one of the following page replacement policies experiences the same number of page faults as the optimal page replacement policy for this program?
Show answer without attempting

Answer: D

Q20

GATE CS 2014 CS-3Memory ManagementNAT1 mark
A system uses 3 page frames for storing process pages in main memory. It uses the Least Recently Used (LRU) page replacement policy. Assume that all the page frames are initially empty. What is the total number of page faults that will occur while processing the page reference string given below?

4,7,6,1,7,6,1,2,7,24, 7, 6, 1, 7, 6, 1, 2, 7, 2
Show answer without attempting

Answer: 6

Q33

GATE CS 2014 CS-1Memory ManagementNAT2 marks
Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is__________.
Show answer without attempting

Answer: 7

Q42

GATE CS 2012 CSMemory ManagementMCQ2 marks−2/3 if wrong
Consider the virtual page reference string
1, 2, 3, 2, 4, 1, 3, 2, 4, 1
on a demand paged virtual memory system running on a computer system that has main memory size of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number of page faults under the corresponding page replacement policy. Then
Show answer without attempting

Answer: B

0/120 correct0 marks

Related topics in Memory Management