garbage collection of WorldObjects #160
Merged
kushalkolar merged 11 commits intomasterfrom Apr 13, 2023
Merged
Conversation
Member
Author
|
GPU VRAM is freed by deleting the |
Member
Author
|
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 |
clewis7
reviewed
Apr 11, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: