CAFE

UNIX

zombie process

작성자Luke|작성시간09.10.22|조회수217 목록 댓글 0

Killing zombie process

Zombie process is an inactive computer process, according to wikipedia article, "...On Unix operating systems, a zombie process or defunct process is a process that has completed execution but still has an entry in the process table, allowing the process that started it to read its exit status. In the term's colorful metaphor, the child process has died but has not yet been reaped..."

So how do I find out zombie process?

Use top or ps command:
# top
OR
# ps aux | awk '{ print $8 " " $2 }' | grep -w Z

Output:

Z 4104
Z 5320
Z 2945
[Solaris] 
When a process dies, it becomes a zombie process. Normally, the parent performs a wait() and cleans up the PID. Sometimes, the parent receives too many SIGCHLD signals at once, but can only handle one at a time. 
It is possible to resend the signal on behalf of the child via kill -18 PPID. Killing the parent or rebooting will also clean up zombies. The correct answer is to fix the buggy parent code that failed to perform the wait() properly. 
Aside from their inherent sloppiness, the only problem with zombies is that they take up a place in the process table. 
preap 
# ps -efl|grep 551
 0 Z     root   551   550   0   0  -        -      0        -        - ?           0:00 <defunct>
# preap 551
551: exited with status 0
# ps -efl|grep 551

In above example this tool successfully remove zombie process. Otherwise the only way to kick them off is reboot

 

 

다음검색
현재 게시글 추가 기능 열기

댓글

댓글 리스트
맨위로

카페 검색

카페 검색어 입력폼