-
Notifications
You must be signed in to change notification settings - Fork 3
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
Garbage collector performance issue #5
Comments
There is unfortunately no direct way to do this in the current version. For example, if you are binding an |
Well I'm currently generating SKimages in a background thread which calls an eventhandler which then replaces the bound source in the view model. Not sure if there is a cleaner solution for it tho, I had been struggling with a variety of issues, currently it does sorta depend on the view model to dispose old frames... Been tinkering with my own control but that still has a ton of other issues as I render directly to the canvas which makes stuff like double click events not work (and it flickers sometimes...) |
For example, what if there was a method like (I just thought of this, so I haven't thought deeply about whether this method is appropriate or not.) |
I mean it doesn't sound like the cleanest solution there is, but it should work for my use case. |
Don't expect anything. If I get some time, I'll try to implement it :) |
This is my own implementation now which is based on yours. Basically the issue is that a new "WriteableBitmap" gets created with each new Source, that causes the garbage collector to go mad. Maybe you can also implement it on your end, but that might be quite some work... Treat this as a minimal solution/example. Ofc you still gotta manage disposal of old instances in the code that creates the bitmaps. My code:
} edit: added clear |
Thanks, I will refer your code! |
Hey, using this in avalonia 11 and works pretty good out of the box, only minor issue I have that I do swap my bound image at like 30-60 fps and this makes it call the gc to dispose the old image alot.
Is there any way to circumvent this?
The text was updated successfully, but these errors were encountered: