Assuming that I decide, for some reason, to never use the syscall wait
ever again in any of the programs I write.
Does it mean that my memory will be cluttered with all the finished processes that their father didn't wait for?
This is a part of an academic assignment and I find the question a bit perplexing because both answered sound acceptable to me.
This is how I answered this and I simply want feedback if that's indeed true.
If the father process doesn't wait for his children before exiting - these children will be linked to the init
process on the exit
call (inside the function forget_original_parent()
)on the father process.
At some point, the init process will hold more processes than it can - regarding memory limits.
So not calling wait
is indeed cluttering the memory.
Also, I would love clarification on what happens in this case? does the machine shuts down and exits the init process? what happened to all of the children of init if that's the case?