Why should long-running programs always reap their zombie children?

Viewed 153

I am reading a textbook on parent/child process, and the author says:

If a parent process terminates without reaping its zombie children, then the kernel arranges for the init process to reap them. However, long-running programs such as shells or servers should always reap their zombie children. Even though zombies are not running, they still consume system memory resources.

but according to the answer of this question What does reaping children imply?
it seems that most/all of zombies' resources are released, only one resource that's definitely still consumed is that process table slot. I am not familiar with the process table slot, but I think it stores exit status of zombies.

Anyway, so one record in the process table slot doesn't sound like a big deal, probably just consumes a couple of bytes/kb in memory, so why long-running programs should always reap their zombie children by calling wait variants?

1 Answers

There is a maximum number of processes, and it can be as low as 32768.

Zombie processes still count as processes for this purpose.

If you create many thousands of zombie processes and don't reap them, the system won't be able to create any more processes. And that's bad.

Related