zombie process

Before explaining the concept of a zombie process, we must first understand the fact that
after a process terminates for some reason, it is not immediately cleaned up from the system by the kernel as most people think, but is kept in A terminated state, waiting to be reclaimed by its parent process. After being reclaimed by the parent process, the kernel will pass its exit status to the parent process before discarding it. It is only from this moment that the termination process has truly disappeared.
Based on this fact, it is not difficult to come up with the general concept of a zombie process, that is, a process that has been terminated but not yet reclaimed. Because it also needs the kernel to retain some of its state for the parent process to recycle, it consumes some resources. So for long running programs like shells or servers etc, zombie processes should always be recycled. If the parent process is killed before it recycles its zombie children, the kernel calls the init process (PID 1, created by the kernel when the system is initialized) to recycle them.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326627530&siteId=291194637