CS FundamentalsVery hardGATE CS

Swap space is configured at 2 GB, RAM is 8 GB, and the OS uses overcommit. A process mallocs 20 GB and touches only 1 GB. What happens on Linux with default heuristic overcommit?

  1. A. malloc fails immediately because 20 GB exceeds RAM plus swap
  2. B. The kernel zero-fills 20 GB at malloc time
  3. C. The system deadlocks
  4. D. The allocation usually succeeds; only touched pages need frames, so the process runs normally

Correct answer: D. The allocation usually succeeds; only touched pages need frames, so the process runs normally

Virtual memory is reserved lazily; frames are assigned on first touch. Heuristic overcommit refuses only obviously excessive requests, and the OOM killer acts if touched memory later exceeds RAM + swap.

More Operating Systems questions

Exams that ask this topic