Follow

@ekaitz_zarraga

(little implicit premise: when I say "fork" I mean Plan9 style rfork, that let you specify what is inherited by the parent process... except for the stack, which is inherited anyway)

The fact is that both inherited memory and `malloc`ed one (and even `mmap` one in linux, afaik!) is just a promise you get from a cheating kernel: the physical memory is NOT assigned to the process until the last possible instant (the memory access fault).

In this is also true for the stack that is handled as copy on write, but I'd guess on and , all other segments are CoW too.

Also in a Plan9 system, pages are 4096 bytes chunks, so the CoW is pretty conservative and after a fork only one new physical page is assigned to the new process (the page where the return value of the fork syscall get written).

So, in theory, fork is not that coarse memory hungry faggot.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.