UGC NET · PAPER 2
UGC NET Paper 2 Computer Science – Operating Systems PYQ: Memory Management & Virtual Memory
Q1.
Given 4 GB (≈ 4.3 × 10⁹ bytes) of virtual address space and a page size of 4 KB (= 4 × 10³ bytes), with each page table entry 5 bytes: how many virtual pages would this imply, and what is the size of the whole page table?
- (A) 107500 pages and 20480 bytes
- (B) 215000 pages and 40960 bytes
- (C) 10750 pages and 10240 bytes
- (D) None of the above
Q2.
An address in main memory is called:
- (A) Virtual address
- (B) Memory address
- (C) Logical address
- (D) Physical address
Q3.
A table T with 17 rows and 1024 columns is stored in memory. T[i][j] and the variable temp are 32-bit floating-point values; memory is word-addressable (1 word = 1 element) and temp is kept in a processor register (no memory reference for temp). Main memory can hold only 16 pages of 1024 words each, with LRU page replacement. The following program computes and prints the average of every column:
If T is stored in the virtual address space in row-major format, what is the main memory hit ratio?
for j = 0 to 1023:
temp = 0
for i = 0 to 16:
temp = temp + T[i][j]
print(temp / 17.0)If T is stored in the virtual address space in row-major format, what is the main memory hit ratio?
- (A) 0
- (B) 1
- (C) 2
- (D) 3
Q4.
Using the same table T (17 rows × 1024 columns, 32-bit word-addressable entries, 16 page frames of 1024 words each, LRU) and the same column-averaging program as above, now consider T stored in column-major format. How many page faults will be encountered while running the program?
for j = 0 to 1023:
temp = 0
for i = 0 to 16:
temp = temp + T[i][j]
print(temp / 17.0)- (A) 14
- (B) 15
- (C) 16
- (D) 17
Q5.
Using the same table T (17 rows × 1024 columns, 32-bit word-addressable entries, 16 page frames of 1024 words each, LRU) and the same column-averaging program as above, now consider T stored in row-major format. How many page faults will be encountered while running the program?
for j = 0 to 1023:
temp = 0
for i = 0 to 16:
temp = temp + T[i][j]
print(temp / 17.0)- (A) 16,402
- (B) 17,408
- (C) 18,208
- (D) 18,608
Q6.
Using the same table T (17 rows × 1024 columns, 32-bit word-addressable entries, 16 page frames of 1024 words each, LRU) and the same column-averaging program as above, now consider T stored again in column-major format. What is the main memory hit ratio?
for j = 0 to 1023:
temp = 0
for i = 0 to 16:
temp = temp + T[i][j]
print(temp / 17.0)- (A) 80%
- (B) 95.6%
- (C) 97.8%
- (D) 99.9%
Q7.
Using the same table T (17 rows × 1024 columns, 32-bit word-addressable entries, 16 page frames of 1024 words each, LRU) and the same column-averaging program as above, what is the ratio of the number of page faults with T stored in row-major order to the number of page faults with T stored in column-major order?
for j = 0 to 1023:
temp = 0
for i = 0 to 16:
temp = temp + T[i][j]
print(temp / 17.0)- (A) 1024 : 1
- (B) 1301 : 1
- (C) 1240 : 1
- (D) 9107 : 8
Q8.
A virtual memory system uses the first-in-first-out (FIFO) page replacement policy and allocates a fixed number of frames to a process.
Assertion A: Increasing the number of page frames allocated to a process sometimes increases the page fault rate.
Reason R: Some programs do not exhibit locality of reference.
Assertion A: Increasing the number of page frames allocated to a process sometimes increases the page fault rate.
Reason R: Some programs do not exhibit locality of reference.
- (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
Q9.
Which of the following statement(s) is/are correct with respect to virtual memory?
Statement I: Address translation is performed for every logical address used during the execution of a program.
Statement II: A program can execute only when all of its components are loaded in memory.
Statement I: Address translation is performed for every logical address used during the execution of a program.
Statement II: A program can execute only when all of its components are loaded in memory.
- (A) Both Statement I and Statement II are correct
- (B) Both Statement I and Statement II are incorrect
- (C) Statement I is correct but Statement II is incorrect
- (D) Statement I is incorrect but Statement II is correct
Q10.
Which of the following statement(s) is/are correct with respect to virtual memory?
Statement I: Address translation is performed for every logical address used during the execution of a program.
Statement II: A program can execute only when all of its components are loaded in memory.
Statement I: Address translation is performed for every logical address used during the execution of a program.
Statement II: A program can execute only when all of its components are loaded in memory.
- (A) Both Statement I and Statement II are correct
- (B) Both Statement I and Statement II are incorrect
- (C) Statement I is correct but Statement II is incorrect
- (D) Statement I is incorrect but Statement II is correct
Q11.
A virtual memory system uses the first-in-first-out (FIFO) page replacement policy and allocates a fixed number of frames to a process.
Assertion A: Increasing the number of page frames allocated to a process sometimes increases the page fault rate.
Reason R: Some programs do not exhibit locality of reference.
Assertion A: Increasing the number of page frames allocated to a process sometimes increases the page fault rate.
Reason R: Some programs do not exhibit locality of reference.
- (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
Q12.
Which of the statement is not true in regards to virtual memory?
(i) The main objective for using virtual memory is to increase the effective capacity of the memory system.
(ii) Size of the program can be as large as the size of the secondary memory.
(iii) Program and data are stored in the secondary memory.
(i) The main objective for using virtual memory is to increase the effective capacity of the memory system.
(ii) Size of the program can be as large as the size of the secondary memory.
(iii) Program and data are stored in the secondary memory.
- (A) The main objective for using virtual memory is to increase the effective capacity of the memory system
- (B) Size of the program can be as large as the size of the secondary memory
- (C) Program and data are stored in the secondary memory
- (D) None of these
Q13.
For the following page reference string: 4, 3, 2, 1, 4, 3, 5, 4, 3, 2, 1, 5 — the number of page faults that occur using the Least Recently Used (LRU) page replacement algorithm with frame size 3 is:
- (A) 6
- (B) 8
- (C) 10
- (D) 12
Q14.
Given memory access time as p nanoseconds and an additional q nanoseconds for handling a page fault, what is the effective memory access time if a page fault occurs once for every 100 instructions?
- (A) p + q/100
- (B) (p + q)/100
- (C) p + q
- (D) p/100 + q
Q15.
Consider a machine with 16 GB of main memory and a 32-bit virtual address space, with page size 4 KB (frame size equals page size). If a process of size 34 KB is to be executed on this machine, what will be the size of internal fragmentation for this process?
- (A) 1 KB
- (B) 2 KB
- (C) 4 KB
- (D) Zero
Q16.
(Same machine as above: 16 GB main memory, 32-bit virtual address space, 4 KB page size.) What is the size of the page table needed to handle the given virtual address space, given that each page table entry is of size 2 bytes?
- (A) 12 KB
- (B) 2 KB
- (C) 2 MB
- (D) 32 MB
Q17.
(Same machine as above: 16 GB main memory, 32-bit virtual address space, 4 KB page size.) What is the minimum number of bits needed for the physical address?
- (A) 12
- (B) 24
- (C) 28
- (D) 34
Q18.
(Same machine as above: 16 GB main memory, 32-bit virtual address space, 4 KB page size.) The number of bits reserved for the frame offset is ____.
- (A) 12
- (B) 14
- (C) 32
- (D) 8
Q19.
(Same machine as above: 32-bit virtual address space, 4 KB page size.) Find the number of pages required for the given virtual address space.
- (A) 2^10
- (B) 2^12
- (C) 2^20
- (D) 2^30
Q20.
Consider a hypothetical machine with 3 pages of physical memory, 5 pages of virtual memory, and as the stream of page references by an application. If P and Q are the number of page faults the application would incur with the FIFO and LRU page-replacement algorithms respectively (assuming enough space for storing 3 page frames), then (P, Q) = ____.
- (A) (11,10)
- (B) (12,11)
- (C) (10,11)
- (D) (11,12)
Q21.
For the page reference string 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1 with 3 page frames (initially empty), which page replacement algorithm produces the minimum number of page faults?
- (A) FIFO
- (B) LIFO
- (C) LRU
- (D) Optimal
Q22.
Which of the following is incorrect for virtual memory?
- (A) Large programs can be written
- (B) More I/O is required
- (C) More addressable memory is available
- (D) Faster and easier swapping of a process
Q23.
A memory management system has 64 pages with a page size of 512 bytes. Physical memory consists of 32 page frames. The number of bits required in the logical and physical addresses are respectively:
- (A) 14 and 15
- (B) 14 and 29
- (C) 15 and 14
- (D) 16 and 32
Q24.
Consider the page-reference string: 0 1 2 3 0 1 4 0 1 2 3 4. If the FIFO page-replacement algorithm is used, find the number of page faults for (a) 3 page frames and (b) 4 page frames, respectively.
- (A) 10, 9
- (B) 9, 9
- (C) 10, 10
- (D) 9, 10