Apr 26, 2023
I found this: https://stackoverflow.com/questions/74923140/matplotlib-memory-leak-using-figurecanvastkagg
more recent than your post and there's a gnarly workaround.
Hope that helps!
EDIT: might already have been fixed: https://github.com/matplotlib/matplotlib/pull/22002