I have a program that I want to run in python on about 20 cores (for a research math question) but the code has a bit of a memory leak. It is ok running small batches of this code but I would really like to just let it run on these cores for say a couple weeks. Is there any way in Python to build in an automatic restart or something to avoid the long-term memory issues? Delete function does not help. Any help is appreciated!
Asked
Active
Viewed 1,189 times
1
-
If I understand well, you have a kind of Python service/daemon that performs calculations and you want to restart it. If it is a service, why not killing it and restart it in a cron? – Laurent LAPORTE May 25 '18 at 03:40
2 Answers
1
first, persistent your compute status and result, then write a detect function to detect the memory leak, stop the program, using supervisor or pm2 to restart it.

Xiaoyu Xu
- 858
- 6
- 5