0

I read somewhere (forgot where) that a zombie process continues to consume the process table entry (concretely the process identifier or PID), and causes a resource leak.

Is it correct that a zombie process doesn't use cpu, nor memory except its process table entry. Is that all the resources a zombie process still occupies?

Can the used resources be a reason to remove a zombie process?

Is there some need to remove a zombie process?

0

2 Answers 2

2

A zombie process is a process that has terminated (normally or abnormally) without its parent wait(2)-ing for it. It doesn't consume resources (aside from a PID) since it's already dead. Wikipedia has a decent explanation for all this.

1

The system uses a limited number of PIDs (2^16 I think). If all the PID slots are occupied, the system won't be able to create new processes. That is the reason you should take care to reap your zombies, especially if your program creates a lot of processes (e.g., if you're a forking server).

Not the answer you're looking for? Browse other questions tagged .