Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zombie vs Defunct processes?

Is there a difference between zombie and defunct processes? I have found the wikipedia article where it is written that this two are the same. In that case why it is needed to have 2 different terms for the same process:

https://en.wikipedia.org/wiki/Zombie_process

like image 994
user2420079 Avatar asked Dec 26 '17 10:12

user2420079


People also ask

Is defunct process the same as zombie process?

A defunct process, also known as a zombie, is simply a process that is no longer running, but remains in the process table to allow the parent to collect its exit status information before removing it from the process table.

What are zombie processes?

A zombie process is a process in its terminated state. This usually happens in a program that has parent-child functions. After a child function has finished execution, it sends an exit status to its parent function.

What is the difference between zombie and orphan process?

An orphan process is formed when it's parent dies while the process continues to execute, while zombie process is a process which has terminated but it's entry is there in the system.


1 Answers

Both Zombie and defunct are same. ZOMBIE is the one of the state of the process while there is no defunct state, you can see it from your kernel source code.

enum proc_state {
    UNUSED,   /*** processes in initial state **/
    EMBRYO, 
    SLEEPING,
    RUNNABLE, 
    RUNNING, 
    ZOMBIE   /** processes in final state **/
};

Zombie state means where it has exited but has not yet been cleaned up.

you can open man page of proc(1) and see this /proc/[pid]/stat Status information about the process. This is used by ps(1).

like image 78
Achal Avatar answered Sep 28 '22 10:09

Achal