Do zombie processes cause memory shortage? Do they get killed by the init process eventually?

5,230
  1. Zombie processes don’t use up any system resources. (Actually, each one uses a very tiny amount of system memory to store its process descriptor.) However, each zombie process retains its process ID (PID)

  2. Linux systems have a finite number of process IDs – 32767 by default on 32-bit systems. If zombies are accumulating at a very quick rate – for example, if improperly programmed server software is creating zombie processes under load — the entire pool of available PIDs will eventually become assigned to zombie processes, preventing other processes from launching.

  3. Getting Rid of Zombie Processes

    kill -s SIGCHLD pid
    

Credit goes to : HTG

Share:
5,230

Related videos on Youtube

Kim Hyung-seok
Author by

Kim Hyung-seok

Updated on September 18, 2022

Comments

  • Kim Hyung-seok
    Kim Hyung-seok over 1 year

    I have a zombie process problem.

    I read What is a <defunct> process, and why doesn't it get killed? which says

    There is no harm in letting such processes be unless there are many of them. Zombie is eventually reaped by its parent (by calling wait(2)). If original parent hasn't reaped it before its own exit then init process (pid == 1) does it at some later time.

    I don't understand this.

    Does it mean that eventually the zombie process's entry will be deleted from process table and killed successfully by the init process (Pid = 1)?

    I think zombie processes causes a memory shortage problem, because they don't return allocated memory space.

    Am I right?

  • Kim Hyung-seok
    Kim Hyung-seok over 9 years
    In your link HTG. It said, when the process created the zombies ends, init process inherits the zombie process. And init execute the wait() system call to clean up its zombie children. Q1. How does it periodically call wait() to clean up?
  • Tim Ludwinski
    Tim Ludwinski almost 7 years
    It might depend on the init process, but I see no reason that the init process wouldn't reap the zombies as soon as they are attached to the process.