-
Notifications
You must be signed in to change notification settings - Fork 62
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_OBJECTSdict infastplotlib.graphics._baseused internally byfastplotlibto keep track of all pygfxWorldObjectinstances in a session.Graphicinstances only use a weak reference proxy to access theirWorldObjectusing their hex id. All references to world objects outside of this dict are via proxies.GRAPHICSdict infastplotlib.layouts._baseto keep track of allGraphicobjects, 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 aGraphicshould 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
LineSlideris added inPlotAreabut don't need to check garbage collection since their memory footprint is very small. UPDATE: This isn't necessary,LineSlidercontinues to work.RAM freed and tested for: