Linux: Terminating a Zombie Process in Linux Environments

摘要: What is a Zombie Process, how to find it, and how to kill or terminate it.

本文章適用於 本文章不適用於 本文無關於任何特定產品。 本文未識別所有產品版本。

說明

What is a Zombie Process:
It is a process that ended but not all of it is Immediately removed from the memory as its process descriptor stays in memory.

What should be the normal Behavior of a Process:
When a process ends, the process's status becomes EXIT_ZOMBIE and the process's parent is notified that its child process has died with the SIGCHLD signal.

The parent process is then supposed to run the wait() for the system call to read the dead process's exit status and other information. After wait() is called, the zombie process is removed from memory. This happens quickly, so you do not see zombie processes accumulating on your system. But in cases where we see several zombie processes accumulating, this is a situation where the program code is not efficient.

How to Find a Zombie Processes:
Running the command top
results from Top command

Running the command ps -ef | grep defunct
result of defunct command

How to Terminate Accumulating Zombie Processes:
Most of the time, the zombie processes have the same parent process ID.

There are two methods to remove the process:
  • Send the SIGCHLD signal to the parent process.
This signal tells the parent process to run the wait() system call and clean up its zombie children:
kill -s SIGCHLD <PPID>
Example:
kill -s SIGCHLD 2201
  • Kill the zombie parent process
kill -9 <PPID>
Example:
kill -9 2201

受影響的產品

SUSE Linux Enterprise Server 12, Red Hat Enterprise Linux Version 7, Red Hat Enterprise Linux Version 9, Red Hat Enterprise Linux Version 8, SUSE Linux Enterprise Server 15, Ubuntu Server LTS
文章屬性
文章編號: 000019108
文章類型: How To
上次修改時間: 03 Feb 2026
版本:  5
向其他 Dell 使用者尋求您問題的答案
支援服務
檢查您的裝置是否在支援服務的涵蓋範圍內。