Zombie processes

Are not uncommon on a Unix system. In essence a zombie proces is a finished process that still has an entry in the process table with the exit code. They don’t exist in memory anymore and don’t utilise any system resources.

As soon as the processes parent requests the exit code from the process table the entry will be removed.

Demonstration of zombie proces

This behaviour can be demonstrated easily with a small shell script. The shell script will launch two processes in the background that will complete in a couple of seconds.

Before the complete their parent process will be stopped (paused). As a result the parent will never request the exit code leaving the two processes as zombies on the system.

If you resume the stopped process it will request those entries and hence, the zombies are gone.

Script to create a zombie proces

I use the following script.

 

Disclaimer: All information posted is written with the upmost care and valid at the time of writing. Changes in versions can supersede the provided information. Please use your own judgement.