in reply to Re^5: Memory consumption of forks on exit
in thread Memory consumption of forks on exit

I'm sorry, but that doesn't work out on my machine. The peak is still there

  • Comment on Re^6: Memory consumption of forks on exit

Replies are listed 'Best First'.
Re^7: Memory consumption of forks on exit
by Marshall (Canon) on May 19, 2011 at 13:12 UTC
    An END block is not a sub. Take sub off. Just END{...}. The END block will execute before program really exits thereby calling the type of exit you want instead of the normal one as previous monk pointed out.
      An END block is not a sub. Take sub off.

      The parser allows sub <SPECIALNAME>; it's not an error.

      >perl -E"sub BEGIN { say 'BANG!'; } sub END { say '2012'; }" BANG! 2012

      Peaks:

      for (1 .. 10) { unless (fork) { exit(); } } END { POSIX::_exit(0); }
        Well at least you are executing the END block now. A print in the END block would show that it gets called 11 times. did you try the other idea of using exec "/bin/true" in the END block?