home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!psinntp!dg-rtp!hobbit!hunt
- From: hunt@dg-rtp.rtp.dg.com (Greg Hunt)
- Subject: Re: <defunct> Zombies
- Message-ID: <1992Dec17.151254.4317@dg-rtp.dg.com>
- Sender: hunt@hobbit.rtp.dg.com (Greg Hunt)
- Date: Thu, 17 Dec 92 15:12:54 GMT
- Reply-To: hunt@dg-rtp.rtp.dg.com
- References: <6JwuVB11w165w@iowegia.uucp>
- Organization: Data General Corp., Research Triangle Park, NC
- Lines: 55
-
- In article <6JwuVB11w165w@iowegia.uucp>, kjhoule@iowegia.uucp (Kevin Houle) writes:
- > I'm learning to manage a Wyse 9000i running Wyse's Sys V Unix, and have
- > a question concerning zombie processes. A few days ago, the current
- > admin rebooted the machine to clear out some processes he described as
- > "defunct". I asked how you see these processes, and he said to use ps.
- >
- > So I did. And I read up in the man pages about ps. The process state 'Z'
- > means the process is in zombie state, and that it is finished but the
- > parent process has not begun waiting for it. If it does in fact even
- > HAVE a parent process, the process is marked as <defunct> in the
- > listing. So I'm thinking, the mere fact the process is marked defunct
- > means it has a parent that very well may come a' lookin' for the zombie.
- > Am I right?
-
- Right. Glad to see you were curious enough to read up on things for
- yourself.
-
- > Are zombie processes really a problem, and if so, can't the kill command
- > be used to get rid of them? I hate the idea of rebooting the machine all
- > the time and don't think it is needed.
-
- They can be a problem if the parent creates lots of child processes and
- never waits for the completion status from them. This will eventually
- fill up the process tables, and then no more processes will be able to
- be created on the system.
-
- The right way for any parent process that creates children to handle
- this is to remember to wait for the completion status of each child
- at some point. Various calls are available to do this, including
- wait(2) and waitpid(2). There are options for pending until any child
- completes, pending until a specific child completes, or not pending if
- no children have completed recently.
-
- If the parent of a child exits, then the child will be adopted by the
- init process. The init process periodically wakes up and will get the
- completion status of adopted children, and then those zombies will
- disappear.
-
- The kill command can't get rid of a zombie, because the process is
- already dead. They shouldn't consume many resources, just a slot in
- the process table and whatever is needed to return the completion
- status. The only ways to get rid of them are to have the parent wait
- for the zombie, or rebooting the system.
-
- Rebooting the machine to get rid of zombies is quite extreme, and in
- my opinion means that there is at least one parent process on the
- system that isn't following the rules. It should be found and fixed.
-
- Hope this helps.
-
- --
- Greg Hunt email: hunt@dg-rtp.rtp.dg.com
- DG/UX Core Development
- Data General Corporation
- Research Triangle Park, NC, USA These opinions are mine, not DG's.
-