1

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?

user2909415
  • 979
  • 3
  • 10
  • 26

2 Answers2

0

I think I'd refer you to this post where he does a great job of explaining how other threads behave.

Community
  • 1
  • 1
trmiller
  • 183
  • 5
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