cocodataset/panopticapi

close multiprocessing safely

yangia opened this issue · 3 comments

I think

workers.close()
workers.join()

should be added right before the return xxx in method combine_to_panoptic_multi_core and pq_compute_multi_core for closing multiprocessing safely, as my collegue found it might not release the memory properly. I agreed and adopted it, but I didn't test it.

I found the problem too, this has actually caused several downtimes at the server of my boss. I have tested it, and it works well now.

Agreed. Not closing led to memory leaking problems. The solution proposed by @yangia solved the problem for me.

Agreed. @yangia thanks for that.
I test it, and workers.close() is enough to close the process.