CS FundamentalsModerateGATE CS

Which feature lets an OS allocate memory for a growing stack only when it is actually touched?

  1. A. Allocating the maximum stack size at exec() time
  2. B. Lazy (demand) allocation: unmapped stack pages fault on first touch and the fault handler allocates a zero-filled frame
  3. C. Compaction of the stack segment
  4. D. Using a larger TLB

Correct answer: B. Lazy (demand) allocation: unmapped stack pages fault on first touch and the fault handler allocates a zero-filled frame

The stack region is reserved in the address space but backed only when referenced; the page-fault handler recognises a legal stack access and maps a new zero page.

More Operating Systems questions

Exams that ask this topic