Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's not "hard" to implement fork without overcommit. tl;dr: have a big swap file. Don't worry, that swap file won't actually be used.

Really, fork works fine in a strict accounting world. You can turn off overcommit now on any Linux system, and in practice, nothing will go wrong. While it's true that fork requires that the system prepare for the possibility that the child might dirty all its parent's memory, it's just a matter of book-keeping to do and involves no actual inefficiency. If you have enough swap, the kernel can use that swap as memory "reserves" and allow even huge processes to fork.

Big programs (of which there are few) really should all be modified to use vfork, though, which doesn't make COW mappings and so doesn't incur the commit charge hit.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: