Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What is a zombie process or thread, and what creates them? Do I just kill them, or can I do something to get diagnostics about how they died?

share|improve this question
11  
you cut their head. Or you burn them. That is the only way. –  Simon Sep 7 '12 at 8:26
    
"Beat 'em or burn 'em, they go up pretty easy"... –  TMN Sep 7 '12 at 16:39
add comment

4 Answers 4

up vote 10 down vote accepted

What is a zombie process or thread, and what creates them?

A zombie process is a dead processes.
The OS is just keeping information around so the parent can check the exit code of the processes at some later point as such the OS keeps information about them and thus they turn up when looking at processes.

Do I just kill them,

No. They are already dead.
The OS will clean up when the parent dies or gets the status code from the OS.

or can I do something to get diagnostics about how they died?

No. The parent can but not the shell.

share|improve this answer
add comment

A zombie thread is a thread that have terminated its execution but didn't terminated cleanly. It deallocates the resources used by the thread but keeps an entry in the thread/process table.

Theoretically, the zombie thread exits from this status by executing a _join (POSIX). It means that when your main is finished, the zombie process would be killed with the program.

share|improve this answer
add comment

A zombie process is a process that has both terminated its execution and has been removed from the list of scheduled processes, but has not yet been deleted. Depending upon the OS, tt might or might not still have various resources assigned to it, and may be queried, but it will not run.

Some OS'es (by design) are not allowed to dynamically create or delete resources beyond a certain event point (VxWorks Cert for example). Such systems often work around this limitation by using pre-allocated pools of resources from which they retrieve, return and reuse items. However, when a process on such a system terminates, it can not be deleted and will instead become zombified (terminated and removed from the scheduling list).

Hope this helps.

share|improve this answer
add comment

When the thread/process is killed, but there is still a record in the corresponding table about it, it becomes a zombie.

This can happen when, for example, a parent process creates a child process, but terminates before the child. When the child process terminates, it tells it's parent about terminating. Afterwards the record of the child process is removed from the corresponding table. But it's parent has already terminated, so the record still remains in the table.

There is no way to get rid of zombies but reboot the

share|improve this answer
    
Rebooting is not required. Simply kill the parent process and the zombies will be cleaned up by the system automatically. –  Kevin Panko Nov 19 '13 at 15:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.