StateDescription
Duninterruptible sleep (usually waiting for I/O operations).
Iidle kernel thread.
Rrunning or runnable (on the run queue).
Sinterruptible sleep (waiting for an event to complete).
Tstopped by a job control signal.
tstopped by a debugger during the tracing.
Xdead (should never be seen).
Zdefunct (“zombie”) process; terminated but not reaped by its parent.

State Machine of a process
image

Zombie Process

  • process that has completed execution but still has an entry in the process table.
  • only occupy space in the process table. They take no memory or CPU.
  • This occurs because the process has ended, but its parent process has not yet called wait() to read its exit status, leaving the process in a “dead” state.
  • The purpose of a zombie process is to retain information about the process so the parent can retrieve its exit status. Once the exit status is read by the parent using wait(), the zombie is removed (reaped) from the process table.

Orphan Process

  • child process continues running even after its parent process has terminated.
  • adopted by a special system process, often the init process (PID 1), which then becomes their new parent process. This ensures that the orphan process continues to run and is properly terminated.
  • not generally problematic, as they are still being managed by the operating system and will eventually terminate.
  • Zombie processes use minimal resources, primarily an entry in the process table

proc

  • man 5 proc