![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Zombie process | ruben.rodrigues | Shell Programming and Scripting | 2 | 03-11-2009 11:13 AM |
| zombie process | jeenat | Linux | 5 | 03-28-2008 07:36 AM |
| zombie daemon process!! | rish2005 | UNIX for Advanced & Expert Users | 1 | 11-25-2005 09:59 AM |
| Zombie process | swhitney | UNIX for Advanced & Expert Users | 2 | 10-22-2004 05:12 PM |
| Zombie process | orca | UNIX for Dummies Questions & Answers | 8 | 04-26-2002 02:54 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
init adopts zombie process?
Hi
I tried to create a zombie process with the following program: Code:
int main(void)
{
pid_t pid;
int status;
if ((pid = fork()) < 0)
perror("fork error");
else if (pid == 0){ /* child process*/
exit(0);
}
printf("child process ID: %d\n", pid);
sleep(10);
return 0;
}
In <apue2>, Quote:
Besides, the child process in my program disappears immediately after the parent terminates. As I described, I don't think this is done by init, then who did? |
|
||||
|
So what’s with the zombies??
A zombie process is a process that has completed execution but still has an entry in the process table. This entry is still needed to allow the process that started the (now zombie) process to read its exit status. The term zombie process derives from the common definition of zombie (an undead person) In the term's colourful metaphor, the child process has died but has not yet been reaped. Zombies can be identified in the output from the UNIX ps command by the presence of a “Z” in the “STAT” column. Zombies that exist for more than a short period of time typically indicate a bug in the parent program, the presence of a few zombies is not worrisome in itself, but may indicate a problem that would grow serious under heavier loads. Since there is no memory allocated to zombie processes except for the process table entry itself, the primary concern with many zombies is not running out of memory, but rather running out of process ID numbers. To remove zombies from a system, remove the parent process. When a process loses its parent, init becomes its new parent. Init periodically executes the wait system call to reap any zombies with init as parent. |
|
||||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|