On Linux, fork() gives the child a separate address space whose initial memory contents match the parent’s, but it does not immediately copy every physical memory page. Instead, the processes’ separate page tables can map corresponding virtual pages to the same physical frames. If either process writes to a page still shared this way, the kernel copies that page for the writer and updates its mapping. The result is independent process memory, with page copying deferred until a write makes it necessary.
What “doesn’t duplicate memory” means
The shorthand in the title needs one qualification: Linux does create a child task and duplicate the parent’s page-table structures. What it defers is copying the contents of every mapped physical page. The Linux fork(2) manual describes the implementation as copy-on-write (COW), contrasting its fork-time cost with eagerly copying all pages.
| # | Preview | Product | Price | |
|---|---|---|---|---|
| 1 |
|
Operating Systems: Three Easy Pieces | $28.27 | Buy on Amazon |
| 2 |
|
Operating System Concepts | $92.15 | Buy on Amazon |
| 3 |
|
Modern Operating Systems (4th Edition) | $221.00 | Buy on Amazon |
| 4 |
|
Operating System Concepts | $157.69 | Buy on Amazon |
| 5 |
|
Operating Systems: Principles and Practice | $60.96 | Buy on Amazon |
As an Amazon Associate I earn from qualifying purchases.
That distinction matters because a page table is not the memory it describes. It is a mapping from a process’s virtual addresses to physical frames. The parent and child have separate page-table structures, but entries for corresponding virtual pages may initially point to the same physical frame.
How copy-on-write works after fork()
- Before the call: The parent’s page table maps a virtual page to a physical frame, which contains that page’s data.
- After
fork(): The child has its own address space and page table. Corresponding entries in the parent and child can refer to the same frame, with write protection used to detect an attempt to modify the shared page. - On a write: The CPU’s memory-management hardware reports a page fault when a process tries to write to the protected page. The kernel handles the fault, makes a private copy of the page for the writer, and changes that process’s mapping to the new frame.
- After the copy: The other process continues to map the original frame. Each process can then change its own page independently.
The Linux kernel’s page-table documentation explains virtual-to-physical translation, the MMU and translation lookaside buffers (TLBs), and page faults. Michael Kerrisk’s The Linux Programming Interface describes the specific COW sequence: the shared page is copied for the process that writes it, and that process’s mapping is updated.
#1 Best Overall
What if neither process writes to a page?
No private copy of that page is needed while it remains shared. If a process writes first, that process receives the private copy; the same mechanism applies whether the writer is the parent or the child. Pages that neither process writes can remain physically shared while both use them.
What does fork() cost?
The Linux man-pages project’s fork(2) page, version 6.19, dated 2026-06-05, says: “Under Linux, fork() is implemented using copy-on-write pages, so the only penalty that it incurs is the time and memory required to duplicate the parent’s page tables, and to create a unique task structure for the child.” This describes the benefit at the time of the call compared with eagerly copying page contents; it does not mean fork() is free.
Rank #2
If the processes later write to many shared pages, the kernel must handle the resulting faults and copy those pages. How much work is deferred depends on which pages are written, and the cited sources do not establish a universal speedup or memory-saving percentage.
What memory does the child inherit?
These implementation details are Linux-specific; POSIX defines observable process behavior without requiring Linux’s particular COW implementation. POSIX says the child has its own copy of the parent’s mappings. For MAP_PRIVATE mappings, changes made before fork() are visible to the child, while changes made afterward are visible only in the process that made them. That describes the processes’ behavior, not whether their physical pages are shared.
Linux also documents exceptions to ordinary inheritance: mappings marked MADV_DONTFORK are not inherited, and ranges marked MADV_WIPEONFORK are zeroed in the child. So it is not accurate to say every mapping is inherited with identical contents in every case.
Page-table levels are not the same as copied memory
The Linux kernel documentation describes a five-level page-table traversal in generic code, while noting that architectures can fold levels they do not use. That number is a detail of Linux’s generic page-table model, not a claim that every processor uses five physical levels. In either case, page-table structure and page contents are distinct: copying or setting up mappings is different from copying the data pages those mappings reference.
Quick Recap
Best Value
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minute




