Glossary · Term

copy-on-write

← all terms

Definition

Plain language

A computer trick where two programs share the same data until one tries to change it, and only then a real copy gets made.

As stated in the literature

A memory and storage optimization in which duplicated state is held by reference and physical copying is deferred until a write occurs; underlies Unix fork, OverlayFS, and reflink-based snapshots.

Also called: CoW

Why it matters: It makes operations like cloning processes and snapshotting filesystems cheap enough to use routinely, which is essential for fast agent sandboxes.

For example, when a Unix process forks, parent and child share the same physical memory pages until one of them writes, at which point only that page is duplicated.

Heard on the show

“… makes a duplicate of a running process, and on modern Linux it's almost instantaneous because of copy-on-write — the duplicate doesn't actually copy any memory, it just gets a second pointer to the same pages, …”
Episode 068 — The OS Trick That Makes Tree Search Practical for Coding Agents

Mentioned in 1 episode

  1. 068
    The OS Trick That Makes Tree Search Practical for Coding Agents

Related terms