I created a small PyQt-based utility in Python that creates PNG graphics using matplotlib when the user clicks a button. Everything works well for the first few clicks, however, every time an image is created, the application’s memory is increased by about 120 MB, eventually all Python crashes.
How to recover this memory after creating a graph? I have included a simplified version of my code here:
import datetime as dt from datetime import datetime import os import gc
The plot.savefig ('graph.png') command seems to absorb memory.
I am very grateful for any help!
python matplotlib memory-leaks pyqt
Eric the Red
source share