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?
- A. malloc fails immediately because 20 GB exceeds RAM plus swap
- B. The kernel zero-fills 20 GB at malloc time
- C. The system deadlocks
- 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
- Which algorithm decides WHICH process to kill when Linux runs out of memory?
- NUMA systems: a thread running on node 0 frequently reads memory allocated on node 1. Which statement is correct?
- Which statement about the clock interrupt frequency (tick rate) is correct?
- A real-time task must respond within 50 µs. Which OS property matters most?
- Assertion (A): Increasing the number of frames given to a process under FIFO can increase its page faults. Reason (R): FIFO does not…
- Assertion (A): A system in an unsafe state will definitely deadlock. Reason (R): In an unsafe state no sequence exists in which all…