I am working with the multiprocessing module on a Unix system. I have noticed memory leaks when I terminate one of my programs. I was thinking that this might be because the processes that were started in the main process kept running. Is this correct?
Asked
Active
Viewed 1,099 times
2 Answers
0
I think I'd refer you to this post where he does a great job of explaining how other threads behave.
-
I think that this would serve better as a comment instead of an answer. – jedwards Mar 17 '15 at 01:30
-
I agree, but can't post comments yet ( < 50 rep ). not sure of a better way to handle until then other than sit it out. – trmiller Mar 17 '15 at 01:35
0
You can just run your program and see if there is python processes alive after the main process terminated.
The correct way to terminate your program is making all the subprocesses terminated before the main process end. (Try to use Process.terminate()
and Process.join()
methods for all subprocesses before the main process terminated.)

curiousY
- 166
- 2
- 9