CS FundamentalsModerateGATE CS
Which feature lets an OS allocate memory for a growing stack only when it is actually touched?
- A. Allocating the maximum stack size at exec() time
- B. Lazy (demand) allocation: unmapped stack pages fault on first touch and the fault handler allocates a zero-filled frame
- C. Compaction of the stack segment
- 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
- A system thrashes at 50 processes. Which of these will reduce thrashing? 1. Using local page replacement 2. Adding more physical memory 3…
- Why is pure LRU rarely implemented exactly in hardware, and what is used instead?
- The aging algorithm keeps an 8-bit counter per page; every tick it shifts the counter right by one and puts the page's reference bit into…
- Which is a disadvantage of a very large page size (e.g. 1 GB pages for all memory)?
- Kernel same-page merging (KSM) / page deduplication scans for identical pages across VMs and maps them to one frame. What makes this safe…
- Writes of at most PIPEBUF bytes to a pipe have which guarantee when several writers share the pipe?