Re: Nasty fork() bomb
From: Laurenz Albe (albe_at_culturallNOSPAM.com)
Date: 02/07/05
- Next message: _at_: "Version Control for conf/rc/... files"
- Previous message: Bern: "Monitoring a binary"
- In reply to: Sudheer: "Nasty fork() bomb"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 7 Feb 2005 15:59:13 +0000 (UTC)
Sudheer <sudheerreddy.p@gmail.com> wrote:
> I have a program which forks for 5 times. Its children fork 5
> times. These children fork five times.... This is done 10 times. The
> 10th generation just exit. This causes about 5^10 + 5^9 + 5^8 + ... +
> 5 forks.
>
> After this the machine freezes for about 30 mins and then
> comes to normal state. Conceptually, fork() after creating huge no of
> child, fails with ENOMEM/EAGAIN. But even after exiting the machine is
> taking long time to come to normal state. Why is this happening? how
> can we avoid?
I would say that the system needs a long time until all the child
processes (which are in the background!) have finished.
Also, all the dead processes must be cleaned up.
All Unices I know have some way to set the maximum number of processes
a user can have. If you set this to some reasonably small value for
non-root users, you are safe.
Yours,
Laurenz Albe
- Next message: _at_: "Version Control for conf/rc/... files"
- Previous message: Bern: "Monitoring a binary"
- In reply to: Sudheer: "Nasty fork() bomb"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|