Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear GPU memory occupied by zombie process if it's parent is init?

nvidia-smi screenshot

The process with PID 14420 is a zombie process and its parent id is 1(init). I want to clear 4436MiB memory occupied by this zombie process without rebooting.

How should I proceed?

like image 553
vikasreddy Avatar asked Nov 07 '16 17:11

vikasreddy


People also ask

How do you stop a zombie orphan process?

To prevent of zombie processes you need to tell the parent to wait for the child, until the child's terminates the process. Down here you have an example code that you can use the waitpid() function.

Where is the parent process zombie process?

The parent process reads the exit status of a zombie process using the wait() function. Then the zombie process is eliminated from the system. After its removal, the process table entry and the process ID can be reused. If the wait() is not used by the parent, the zombie remains in the process table.

What causes zombie processes?

Zombie processes usually occur for child processes, as the parent process still needs to read its child's exit status. Once this is done using the wait system call, the zombie process is eliminated from the process table.


1 Answers

You HAVE to reboot as there is no other way, since the parent is init.

If the zombie process is created every time, all you can do is, you can log the processes and find out the program responsible for this.

like image 128
anantdark Avatar answered Oct 21 '22 16:10

anantdark