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)
temp = 0
for i = 0 to 16:
temp = temp + T[i][j]
print(temp / 17.0)
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: D. 99.9%
Explanation
From the column-major analysis above, the program makes 17×1024 = 17,408 total memory references and causes only 17 page faults (one per page, on the first word of each page, since the sweep is strictly sequential and never revisits a page). So hits = 17,408 − 17 = 17,391, and the hit ratio = 17,391 / 17,408 ≈ 0.99902, i.e. about 99.9%. This matches option (iv), and contrasts sharply with the 0% hit ratio of the row-major layout, showing how badly access-pattern/storage-order mismatches can hurt paging performance.More Programming Languages and Computer Graphics questions
- 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 colum…
- A virtual memory system uses the first-in-first-out (FIFO) page replacement policy and allocates a fixed number of frames to a process. Ass…
- Which of the following statement(s) is/are correct with respect to virtual memory? Statement I: Address translation is performed for every…
- Which of the statement is not true in regards to virtual memory? (i) The main objective for using virtual memory is to increase the effecti…
- 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…
- Given memory access time as p nanoseconds and an additional q nanoseconds for handling a page fault, what is the effective memory access ti…