-
Notifications
You must be signed in to change notification settings - Fork 53
garbage collection of WorldObjects #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
GPU VRAM is freed by deleting the |
GPU VRAM get freed perfectly. System RAM gets cleared to an extent, it doesn't keep growing which is the most important thing. There must be a lingering reference because we create data array in jupyter, and this is the data that we feed to |
Follows up from #159
This implements:
WORLD_OBJECTS
dict infastplotlib.graphics._base
used internally byfastplotlib
to keep track of all pygfxWorldObject
instances in a session.Graphic
instances only use a weak reference proxy to access theirWorldObject
using their hex id. All references to world objects outside of this dict are via proxies.GRAPHICS
dict infastplotlib.layouts._base
to keep track of allGraphic
objects, functions similar to the global world objects dict. All references to Graphic objects outside of this dict are via proxies. The variousplot.add_<graphic>
methods only return proxies.Adds a
PlotArea.delete_graphic()
method which is the only way that aGraphic
should be deleted. This also frees up GPU VRAM.GPU VRAM freed and tested for:
Image
Line
LineCollection
Scatter
[ ] Textwill do this later once text is more stabilizedHeatmap (new one)
Modify how
LineSlider
is added inPlotArea
but don't need to check garbage collection since their memory footprint is very small. UPDATE: This isn't necessary,LineSlider
continues to work.RAM freed and tested for: