GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A process has three segments of 102,400 B (code), 61,440 B (data) and 20,780 B (stack). Each segment is allocated separately in whole pages, so the last page of a segment may be partly unused. Every allocated page needs one 8-byte page-table entry. Among the page sizes 512, 1024, 2048, 4096 and 8192 B, which minimises (page-table bytes + unused bytes in allocated pages), and what is that minimum?

  1. A. 2048 B; 2,476 B
  2. B. 512 B; 3,100 B
  3. C. 4096 B; 4,164 B
  4. D. 1024 B; 2,172 B

Correct answer: D. 1024 B; 2,172 B

For each size count pages per segment (rounding up), then add 8 B per page and the unused tail bytes. 1024 B: 100 + 60 + 21 = 181 pages → 1448 + 724 = 2172 B. 2048 B: 50 + 30 + 11 = 91 pages → 728 + 1748 = 2476 B; 512 B: 3100 B. The averaged rule p = √(2·s·e) ≈ 1720 suggests 2048, but the code and data segments are exact multiples of 1 KB, so they waste nothing at 1024 B.

More Computer Organization and Architecture questions

Exams that ask this topic