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?
- A. 256, since mmap reserves all of the buffer's frames at once
- B. 3, since only touched pages get zero-filled frames on demand
- C. 0, since pages that hold only zeros are never stored
- 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
- Which statement about a system call compared with an ordinary function call is correct?
- Five batch jobs arrive together with run times 9, 6, 3, 5 and x, where x < 3. In what order should they run to minimise average turnaround…
- Statement 1: Under round robin, as the quantum shrinks towards the context-switch time, CPU efficiency approaches 50%. Statement 2: For a…
- Which of these must a process NOT be able to do in user mode on a typical protected OS?
- A process's working set grows from 40 to 70 pages while it holds 50 frames under local replacement, and the system has 10 free frames…
- SRTF scheduling (on a tie the running process continues); processes (arrival, burst): P1 (0, 7), P2 (2, 4), P3 (4, 1), P4 (5, 4), P5 (9…