1. What is a zombie process?
A zombie process is a child process that ends before the parent process, but the parent process does not reclaim the child process and frees the resources that the child process occupies. The zombie process also occupies a slot in the process table, but the process table has limited capacity, and the defunct process not only consumes system resources, but also affects system performance, which can cause the system to fail if the number is large. Here is an image of the explanation: the process immediately after exiting into a zombie, and then wait for the parent process corpse, if the parent process is dead, that is, the process is an orphan, its parent process "Tuogu" the init process, that is, its adoptive father, will help it corpse. If the parent process here is not dead, it depends on what the parent process is doing. If the parent process is calling a wait or waitpid operation, the parent process is prepared to have the coffin paper money, and the process can be buried. or the parent process sets the SIGCHLD signal handler function and performs a wait or waitpid operation in the handler, no problem. But if the parent process is too busy, without any idea of a corpse, the process will have to remain in zombie state until the parent process remembers to wait or waitpid the corpse, or the parent process dies.
2. How to view the zombie process?
2. How to kill the zombie process?