Zombie Process or Defunct Process are those Process which has completed their execution by exit() system call but still has an entry in Process Table. It is a process in terminated state.
When child process is created in UNIX using fork() system call, then if somehow parent process were not available to reap child process from Process Table, then this situation arise. Basically, Zombie Process is neither completely dead nor completely alive but it has having some state in between.
Since, there is an entry for all the process in process table, even for Zombie Processes. It is obvious that size of process table is Finite. So, if zombie process is created in large amount, then Process Table will get filled up and program will stop without completing their task.
Here, our task is to find out Maximum Number of Zombie Process created so that Program will not stop its execution. Approach for this problem is to create a zombie process within a loop and count it until the program does not stop the execution.
Below is the implementation in C of above idea :
In the image, we can see after 11834, the increment of count get stopped. However, this is not a fixed number but it will come around it.
Also, it will depend upon system configuration and strength.
This article is contributed by Aditya Kumar. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Zombie Processes and their Prevention
- Techniques to handle Thrashing
- Process Table and Process Control Block (PCB)
- Pass the value from child process to parent process
- Process states and Transitions in a UNIX Process
- Process Scheduler : Job and Process Status
- Difference between Process Image and Multi Thread Process image
- Process Schedulers in Operating System
- Lottery Process Scheduling in Operating System
- System Protection in Operating System
- Allocating kernel memory (buddy system and slab system)
- User View Vs Hardware View Vs System View of Operating System
- System Programs in Operating System
- Difference between Local File System (LFS) and Distributed File System (DFS)
- File System Implementation in Operating System
- Xv6 Operating System -adding a new system call
- Traps and System Calls in Operating System (OS)
- Introduction of Process Management
- Introduction of Process Synchronization
- Monitors in Process Synchronization
Improved By : Akanksha_Rai