-
Notifications
You must be signed in to change notification settings - Fork 552
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
[BUG] .Net MAUI SKCanvasView memory leak on IOS #2923
Comments
Some DevExpress components have a memory leak due to this issue, which prevents the entire page from being released. This problem is affecting many of our customers. @mattleibow, could you please take a look at this when you have a chance? |
@mattleibow @davidortinau I think this should be critically prioritized, since you can't use SkiaSharp with .NET MAUI on iOS seriously. I think my memory corruption problem mentioned in #2840 maybe because of the same or related issue. |
I just made a test app (see #2951) that confirms this by crashing my iPad by trying to open and close the same page 500 times. It crashes after opening the page c. 145th time. |
I think I know what is happening. After all our work to fix leaks in Maui itself, it appears that an event on the platform view to the handler keeps everything. The platform view event keeps the handler alive, the handler keeps the Xaml view alive and the xaml view keeps the parent alive. The virtual view also keeps the handler alive and the handler keeps the platform view. So basically a big web of survival. However, there has also been a fix in Maui to break the virtual view and it's parent: dotnet/maui#22561 We just have to do something like this: dotnet/maui#18682 Thanks to the hard work of @jonathanpeppers ❤️ |
If some Do you have any on-device tests, can you write one like: And then, the solution would be to fix some of the warnings this analyzer catches: |
Description
If you place SKCanvasView on Page it cause a memory leak.
Code
I create a simple app wich reproduce this leak https://github.com/nevse/maui-tests-SKCanvasViewLeak
Step to reproduce:
I use such code to detect memory leak:
Expected Behavior
No response
Actual Behavior
No response
Version of SkiaSharp
2.88.3 (Current)
Last Known Good Version of SkiaSharp
Other (Please indicate in the description)
IDE / Editor
Visual Studio Code (macOS)
Platform / Operating System
iOS
Platform / Operating System Version
No response
Devices
No response
Relevant Screenshots
No response
Relevant Log Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: