Memory leak when embedding and updating a matplotlib graph in a PyQt GUI

前端 未结 2 1722
轮回少年
轮回少年 2021-01-18 20:52

I am trying to embed a matplotlib graph that updates every second into a PyQt GUI main window.

In my program I call an update function every second using thread

2条回答
  •  轮回少年
    2021-01-18 21:30

    if you are creating a new figure for every time this is quite common.

    matplotlib do not free the figures you create, unless you ask it, somethink like:

    pylab.close() 
    

    see How can I release memory after creating matplotlib figures

提交回复
热议问题