CS FundamentalsHardGATE CS · Amazon/Microsoft SDE MCQ

A system uses demand paging with a 4 KB page, and a process allocates a fresh 1 MB zeroed buffer with mmap but touches only its first 10 KB. Ignoring page-table pages, how many physical frames does the buffer occupy, and why?

  1. A. 256, since mmap reserves all of the buffer's frames at once
  2. B. 3, since only touched pages get zero-filled frames on demand
  3. C. 0, since pages that hold only zeros are never stored
  4. D. 10, one frame for each kilobyte that was touched

Correct answer: B. 3, since only touched pages get zero-filled frames on demand

Anonymous mappings start with no frames; the first touch of each page raises a fault that maps a zero-filled frame. 10 KB spans pages 0, 1 and 2, so 3 frames.

More Operating Systems questions

Exams that ask this topic