Memory leak with GraphicsView in windows #17214
Labels
area-drawing
Shapes, Borders, Shadows, Graphics, BoxView, custom drawing
migration-compatibility
Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert
platform/windows 🪟
s/triaged
Issue has been reviewed
s/try-latest-version
Please try to reproduce the potential issue on the latest public version
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Description
In our custom control, we use multiple Graphics Views, and when users swipe on these views, we initiate a redraw operation by invalidating them. However, we've observed a noticeable increase in committed memory size in the Task Manager after performing these redraws, despite no apparent memory changes in Visual Studio Diagnostics.
In the provided sample, we perform redraw operations on six views. Upon reviewing the attached video, you'll notice a memory increase of 200 MB for each invalidate call.
This memory increase is directly correlated with the canvas size we use. The larger the canvas we utilize, the more memory is consumed.
This memory does not occur when examined in the performance profiler.
Steps to Reproduce
MemoryLeak.mp4
Link to public reproduction project repository
https://github.com/KarthikRajaAKR/Samples/tree/main/MemoryLeak
Version with bug
7.0.92
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
Windows SDK 10.0.19041
Did you find any workaround?
No
Relevant log output
No response
The text was updated successfully, but these errors were encountered: