Process creation, waiting and exit Why finished children still occupy slots The invoice converters have finished their work. Yet the supervisor runs out of process slots. Amir finds their names still listed with a Z beside them and checks which parent owns the exit records. The reference run has zero unreaped children. After a series of failed conversions there are fifty-two. Resident memory stays nearly steady. That points to a record that outlives execution rather than fifty-two busy converters. A process owns an address space, descriptors and a place in the process tree. Fork creates a child with initially shared copy on write pages. Parent in context Exec replaces its program while preserving its process identity. On exit the kernel retains a small record until a parent or designated reaper consumes the status. That record can occupy a process slot even though the program has finished. R includes running and runnable tasks. S commonly waits for a wakeup that signals can interrupt. D denotes an uninterruptible wait, often in an input and output path. A zombie has exited and awaits collection of its status. An orphan is a live or exited child whose parent disappeared and whose parentage has been reassigned. Fork initially shares eligible pages using copy-on-write. A write can allocate a private copy. Exec replaces the child’s address space with the new program. A parent starts a short-lived image worker. The child exits and gives up its user memory. The kernel retains a small exit record until a responsible parent collects its status. That record explains why a process can still have a visible identifier while owning no running computation. Collect the exit record A single process owns its virtual memory mappings. Eligible pages are shared between the parent and child through copy on write. The writing process receives a private copy. The other process keeps the original contents. Exec loads the child’s new program into the same process identity. After the child exits, the parent retrieves its exit status with wait. Compare the system call that creates a child with the operation that replaces its program image. After a successful program replacement, the process continues under its process identity while executing different code. A parent can therefore remain responsible for collecting a child even if the child's visible executable name changes. Match the parent-child relationship and start time, rather than relying on a process name the program may have replaced. Read the measurements If a supervisor starts ten children and remembers to collect only nine, repeating the batch steadily adds exit records. Plot exits and collections as separate events. A flat CPU chart is expected. Raising a task limit might buy time, but the slope will return on the next series of jobs unless the collection path is fixed. A process identifier can be reused after the earlier process has been fully collected. Comparing yesterday's and today's observations by the number alone can attach the wrong parent or executable. Include process start time and namespace with the identifier when tracing which supervisor is accumulating old exit records. Find one parent accumulating children Would raising the process limit repair a parent that skips its wait on every error return? The extra slots buy time. They do not collect an exited child's status. Compare repeated snapshots under the same supervisor, then exercise the successful and failing branches separately. If the task count rises but no children are in Z, inspect live worker growth and the group PID limit. Check the competing explanation A process group lets a shell manage a pipeline as one job. Sessions collect groups and govern controlling-terminal relationships. These boundaries need not match a service’s control group. Traditional daemonization detaches from a terminal through forking and session changes. Under a supervisor, foreground execution often gives the supervisor clearer process ownership and exit status. A job runner creates short-lived converters. RSS stays stable, yet eventually it cannot create another process. Count children by state and parent, then compare the counts across two intervals. A growing set of zombies under one parent points to a missing wait path. Increasing the PID limit only delays recurrence if exits keep accumulating. Exercise the converter’s failure path After the parent collects all completed children, repeating the failure path returns the count to zero. Linux represents each schedulable task with a kernel task structure and references to shared or private state. Threads can share an address space while having different scheduling states. Amir can tell exactly which resource was released. The work ended at exit, but the process slot needed the parent to finish its part. Apply the diagnosis Now consider a worker that is merely waiting for storage. It still has a live execution context and can resume. Its process state and parent relationship distinguish it from a zombie. Check which parent is responsible before intervening. A blanket restart discards precisely the ownership evidence that lets you fix the supervisor.