Zombie process, orphan process

Source: Internet
Author: User
Tags memory usage

One, definition, what is zombie process, orphan process

Orphan process: A parent process exits, and one or more of its child processes are still running, then those child processes will be orphaned processes. The orphan process is adopted by the INIT process (process number 1) and the Init process completes the state collection of them.

Zombie Process: a process that has been terminated, but whose parent process has not yet been dealt with (obtaining information about the terminating process, freeing the resources he still occupies)


Ii. The dangers of the zombie process and the orphan process

UNIX provides a mechanism that can be guaranteed as long as the parent process wants to know the state information at the end of the child process. The mechanism is that when each process exits, the kernel releases all resources for the process, including open files, memory usage, and so on. However, some information is still reserved for it (including the process ID, exit status The termination state of the processes, runtime the amount of CPU time taken by the Proces s, etc.). It is not released until the parent process is fetched through wait/waitpid. But this leads to a problem where the parent process wastes a lot of system resources if it does not process information about the child processes that are already in the signaled state.

Zombie process: By definition and the above know, the zombie process that the parent process does not have the end of the process of processing, occupy a certain amount of system resources, if a large number of zombie processes, will result in the exhaustion of system resources (such as: No process ID, file descriptor).

Orphan process: An orphan process is a process that has no parent process, and when a process becomes an orphan process, it is adopted by the INIT process, and the Init process is written to invoke a wait function to get its termination status whenever a child process terminates. That prevents a lot of zombie processes in the system.


In summary: The zombie process will affect the system, while the orphan process will not

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.