OS & Hardware

What is the advantage of using copy-on-write when duplicating a process?

  1. AThe copy and the original always share whatever either one writes
  2. BOnly pages that get written are copied later, so it is fast and saves memory
  3. CEvery page is copied on each write, improving data safety
Show answer and explanation

Answer: B. Only pages that get written are copied later, so it is fast and saves memory

Copying all memory immediately when duplicating a process is slow and memory-hungry, and wasted if a new program is loaded right after. With copy-on-write, both page tables point to the same physical pages marked read-only; when either side writes, a page fault occurs and the OS copies just that page. Written data is not shared but kept separately in each process, and pages are not all copied.

  • A. After a write the pages become separate and are no longer shared.
  • B. Correct. Only written pages are copied, so it is fast and saves memory.
  • C. Only the written page is copied.
Practice this topic Back to topic

More OS & Hardware questions

  1. Which describes demand paging?
  2. In the clock (second-chance) page-replacement algorithm, what is each page's reference bit used for?
  3. With FIFO page replacement, adding physical pages can sometimes increase page faults. What is this phenomenon called?
  4. What is the state called in which physical memory is so short that pages are constantly evicted and reloaded and little work gets done?
  5. Memory access time is 100 ns and handling a page fault takes 8 ms. If a page fault occurs once per million accesses, what is the average access time approximately?