e, its exit code is Read. The newly created PCB will then be destroyed and its values will be cleared from the processing table, ideally, It will happen in a moment, and dead processing will not be on the processing table for long.
What is the cause of Zombie Process
In most cases, this type of processing is due to poor programming, for example, when older processes run the wait () command for the newly created process, the SIGCHLD command, which is used to announce changes in New processing is ignored.
In some cases, another program may interfere with the SIGCHLD code, this may be due to malware or code programming weakness. In any case, when there is no monitoring of newly created processes, processing Do not announce their changes, and this will not remove dead processes, so these processes will never be removed from the PCB.
Dead processes use very little memory, and usually do not pose any problems for normal use of the operating system. Using these processes does not take up much space on the processing desk, but the problem will arise where the processing is dead. It will not be removed from the processing desk, making it impossible for any other process to run. However, on a 64-bit operating system, this will not be a problem, as the PCB will be larger than the process table.
Many dead processes can simultaneously occupy the free RAM space available for other processes. If there are many dead processes in your system, there may be a problem with your older processes or with the operating system.
Destroy Zombie Process
Enter the following commands in order, on your process table:
Now in the Task section, you can see all your processes in order.
We can list them using the ps command and shape them into columns using egrep.
As we said, dead processes will be shown with the letter z, and we will also add the defunct command. Enter the following command:
ps aux | egrep "Z|defunct"
Dead processes are displayed as a list. Also in the last column of dead processes information, you can see what program or process caused them.
To remove the dead processes we have to proceed through the process they created, enter the following command:
ps -o ppid= -p 0000
In the red field, you have to enter your desired PID.
At the bottom, the terminal will show you the main process that caused the dead process.
Now let’s use the PS command again to see the main process:
ps -e | grep 0000
This time in the red section we will put the main processing number that the terminal gave a little earlier.
We will use the SIGKILL command to delete mother processes:
kill -SIGKILL 0000