Medium Operating Systems Memory Management
What is copy-on-write and how is it used in fork()?
Answer
Copy-on-write (COW) is an optimization that delays copying until modification. In fork(), instead of duplicating entire address space, parent and child share same physical pages marked read-only. When either writes, a page fault triggers copying of that page only. Benefits: fast fork() (just copy page tables), memory efficient (shared read-only data like code), enables efficient fork-exec pattern where child immediately replaces memory with exec().
IIT Certified
Master These Concepts with IIT Certification
175+ hours of industry projects. Get placed at Bosch, Tata Motors, L&T and 500+ companies.
Relevant for Roles
Systems Developer Performance Engineer Software Engineer