Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do zombies harm?

From perlipc/Signals:

eval {
  local $SIG{ALRM} = sub { die "alarm clock restart" };
  alarm 10;
  flock(FH, 2); # blocking write lock
  alarm 0;
};
if ($@ and $@ !~ /alarm clock restart/) { die }

If the operation being timed out is system() or qx(), this technique is liable to generate zombies. If this matters to you, you'll need to do your own fork() and exec(), and kill the errant child process.

I have a similar code, where the operation being timed out is system() or qx().

Is the bad thing about zombies that they consume memory or are there more ways zombies can harm?

like image 388
sid_com Avatar asked Mar 18 '11 10:03

sid_com


People also ask

How do zombies kill?

Killing Zombies is the act of rendering the moving corpse completely motionless once again. It can be argued that the term killing is technically inaccurate, as despite the observed locomotion of the zombie, all other life functions have ceased. Still, the point is mostly one of semantics.

What are zombie weaknesses?

Weaknesses. Stupidity - Zombies have no intelligence and no survival instincts, and so they can be easily lured into traps. Speed - Traditionally, zombies cannot move very fast due to their decayed state and complete lack of coordination, making it relatively easy to outrun them or navigate through them.


2 Answers

The primary issue is that they consume process table slots. Linux's process table can hold 64k entries, so this isn't likely to result in problems unless you do a lot of forking without cleaning up the zombies. I expect that most, if not all, other modern *nixes have process tables of the same size. It does look ugly when you run ps, though.

Memory isn't really a problem, as each zombie only takes up a few bytes to record its exit status.

like image 115
Dave Sherohman Avatar answered Sep 29 '22 20:09

Dave Sherohman


They consume memory and space in the process table.

like image 37
Heiko Rupp Avatar answered Sep 29 '22 20:09

Heiko Rupp