Hi all!
I am using GeoMakie and GeoAxis, in case that makes any difference. My application creates a series of visualizations on the GeoAxis, one at a time. When the user indicates that they want the next visualization, I empty! the geoaxis and then draw the next visualization on the same axis.
The problem is that garbage collection is not happening for all of the plots that are empty!ed. Visually speaking, everything is gone and everything looks right, but I believe that the following is happening:
MakieCore plots (like those created by scatter!, text!, etc) are being garbage collected after empty!, as expected. However, plots that don’t seem to be implemented in MakieCore (like those created by contour!) are not being collected. I noticed this because my calls to contour! involve large matrices so I am rapidly running out of memory as those plots apparently “leak”. I added finalizers to the various plots and I can see them being called for MakieCore plots but not for the others.
Are the non-MakieCore plots perhaps being referenced by something else that I’m not aware of? In addition to empty!ing the axis, I’m also clearing the connect!ions to them, so that’s not it. I don’t hold any references to the plots in my application after they’re created and connect!ed.
On a tangent… I haven’t delved into the “recipe” functionality of Makie, but are things like contour! an example of a recipe?