← Back to context

Comment by jcalvinowens

1 day ago

It is a weirdly common misconception that that fork() is cheap... it is O(N) on the size of the process, and it always has been.

Yes, it's copy on write... but there is a linear relationship between the size of the process and the number of page table entries required to represent it.

> the number of page table entries

This is not exactly fixed since you can vary the amount of memory each page maps with things like hugepages and the same process can run with different page sizes.

  • You can in theory, but it's rare in practice because it isn't always enabled and it requires root to configure.