Does anyone know how to do garbage collection for a glumpy figure?
I have a class which displays movie frames inside a glumpy figure. Whenever an instance of the class is initialised I create glumpy.Image()
instances for each frame, and when I close the figure and delete the UI object the frame data still remains in memory. If I open the UI more than 3-4 times I run out of RAM and start thrashing my hard disk, which is not much fun.
Normal garbage collection using gc.collect()
doesn't seem to work, and from this page
, it seems that I would need to call OpenGl.contextdata.cleanupContext(<context>)
on the OpenGL context for the figure. However, I'm not an OpenGL expert, and I can't tell from the source code when the context is created and where it resides. I tried calling contextdata.cleanupContext(contextdata.getContext())
but that didn't seem to do the trick.