in reply to Help with Fork bomb
I think, the problem might be there: every child continues the loop after sleep 1 and creates more and more grandchildren. Placing exit after sleep fixed the issue for me: before after.$pid = fork; if ($pid == 0){ # Is a child $iterations++; sleep 1; } ... } } if ($pid == 0){ # Is a child exit; }
By the way, separate shell with ulimit -u 300 was very useful for testing this code.
Sorry if my advice was wrong.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Help with Fork bomb
by Anonymous Monk on Aug 30, 2012 at 20:11 UTC | |
by blue_cowdawg (Monsignor) on Aug 30, 2012 at 20:32 UTC | |
by Anonymous Monk on Aug 30, 2012 at 20:47 UTC | |
by ww (Archbishop) on Aug 30, 2012 at 22:47 UTC | |
by aitap (Curate) on Aug 30, 2012 at 20:42 UTC |
In Section
Seekers of Perl Wisdom