Skip to content
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

Memory leak with GraphicsView in windows #17214

Closed
karthikraja-arumugam opened this issue Sep 5, 2023 · 5 comments
Closed

Memory leak with GraphicsView in windows #17214

karthikraja-arumugam opened this issue Sep 5, 2023 · 5 comments
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

Comments

@karthikraja-arumugam
Copy link

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

  1. Run the attached sample.
  2. Open Task Manager.
  3. Click the invalidate button and notice the increase in Task Manager committed memory
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

@karthikraja-arumugam karthikraja-arumugam added the t/bug Something isn't working label Sep 5, 2023
@samhouts samhouts added the migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert label Sep 5, 2023
@Eilon Eilon added the area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing label Sep 5, 2023
@MuniappanSubramanian
Copy link

Any update on this?

@robivin
Copy link

robivin commented Oct 31, 2023

Any update?

@danielancines
Copy link

Any updates?

@Zhanglirong-Winnie Zhanglirong-Winnie added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Feb 7, 2024
@Zhanglirong-Winnie
Copy link

Verified this issue with Visual Studio Enterprise 17.9.0 Preview 5. Can repro on Windows platform with sample project.
https://github.com/KarthikRajaAKR/Samples/tree/main/MemoryLeak

@jsuarezruiz jsuarezruiz added the s/try-latest-version Please try to reproduce the potential issue on the latest public version label Jun 5, 2024
Copy link
Contributor

Hi @karthikraja-arumugam. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

8 participants