CS FundamentalsVery hardGATE CS
int A[128][128] (4-byte ints) is stored row-major in pages of 512 bytes; the array starts on a page boundary and the process has only 2 frames for A (initially empty, LRU). The loop is `for j in 0..127: for i in 0..127: A[i][j] = 0;`. How many page faults occur?
- A. 128
- B. 64
- C. 8192
- D. 16384
Correct answer: D. 16384
Each row is 512 bytes = exactly one page, so A occupies 128 pages. Traversing column-wise touches a different page on every access (row i), and 2 frames cannot hold 128 rows, so all 128 × 128 = 16384 accesses fault. Row-wise traversal would fault only 128 times.
More Operating Systems questions
- Same array int A[128][128], one row per 512-byte page, 2 frames (LRU), but the loop is for i in 0..127: for j in 0..127: A[i][j] = 0;. How…
- A TLB has 128 entries and pages are 4 KB. A process's working set is 2 MB and is accessed uniformly at random. Approximately what fraction…
- A system uses segmentation with paging: a 32-bit logical address has a 4-bit segment number, and each segment is paged with 4 KB pages and…
- A machine has 2 GB of physical memory with 8 KB frames, uses 48-bit virtual addresses, and an inverted page table with 16-byte entries…
- Reference string (times 1 to 20): 2, 6, 1, 5, 7, 7, 7, 7, 5, 1, 6, 2, 3, 4, 1, 2, 3, 4, 4, 4. With window Δ = 5, what is the working-set…
- A system's CPU utilisation is 12% while the paging disk is 98% busy. Which action is most likely to INCREASE CPU utilisation?