Memory Leak cause by plots.update_data() #373
-
Hi, thanks for creating finplot. So far, I have a lot of fun using it. The thing is, I found that computer RAM will go higher and higher after days. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
There is no code within finplot itself that's hogging RAM, but there might be a leak through bad use of API's, etc. Or pyqtgraph or PyQT is causing the leak. Best would be if you could create a minimal example that leaks a lot of memory fast through auto-generated random data, and perhaps I could use some tools to figure out what's going on. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hadn't thought about this scenario. So the default used to be to add incrementally more data, but I hadn't thought about the case where you actually want to remove prior data. In my last commit, the default is to extend the data with the new data supplied (instead of NaNs, which is causing the leak). Hm. Probably better is simply to let the user a) supply all the data — including new, or b) supply all the new data — excluding old (which should no longer be available in the chart). Principle of least surprise, I suppose. I'll let you know when I've fixed it. |
Beta Was this translation helpful? Give feedback.
-
Fix available in e4ab803, allowing updates to shrink data. |
Beta Was this translation helpful? Give feedback.
Fix available in e4ab803, allowing updates to shrink data.