Gangmax Blog

自由之思想,独立之精神

How to Find and Kill Zombie Processes

| Comments

From here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Use top command to know if there's zombie processes or not:
$ top

# Run the following command to get the process Id of the zombie processes:
$ ps aux | grep 'Z'
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
user     13159  0.0  0.0      0     0 ?        Zs   16:17   0:00 [git] <defunct>
user     13160  0.0  0.0      0     0 ?        Zs   16:17   0:00 [git] <defunct>
user     16183  0.0  0.0  18128   952 pts/0    S+   17:20   0:00 grep --color=auto Z

# Get the parent process of the zombie processes:
$ pstree -p -s 13159
init(1)───lightdm(834)───lightdm(8066)───init(8215)───gnome-session(8349)───nautilus(8632)───python(8774)───git(13159)
$ pstree -p -s 13160
init(1)───lightdm(834)───lightdm(8066)───init(8215)───gnome-session(8349)───nautilus(8632)───python(8774)───git(13160)

# Kill the parent process.
$ kill -15 8774

Comments