I'm reading about fork
and exec
for an exam, and my book says that whenever it is needed to run a new (different) process in unix systems, you would fork the current process followed by an execve
.
However, it also says that whenever fork
is called, the whole memory image of the parent is copied to the new process.
Then my question is: What if you have a process with a really big memory image, and you just want to run a new process? Isn't it a waste of resources to copy all the data from the parent process if you are just going to replace it immediately?