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 retention issue persists after setting DataGrid to "null" #4986

Open
3 of 14 tasks
ChidanandMurugaiah opened this issue May 10, 2024 · 0 comments
Open
3 of 14 tasks
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior

Comments

@ChidanandMurugaiah
Copy link

Describe the bug

I'm currently using the CommunityToolKit DataGrid in my application. Upon adding the DataGrid through a button, I observed that the application's memory usage increased from 98MB to 108MB. However, even after setting the DataGrid reference to null upon button click, the memory usage remains at 108MB instead of reverting back to the initial 98MB.

Additionally, I need confirmation on the proper method to dispose of the Community DataGrid. Is simply setting the DataGrid reference to null sufficient, or are there additional steps that need to be taken?

Regression

No response

Reproducible in sample app?

  • This bug can be reproduced in the sample app.

Steps to reproduce

1.Run the sample
2.Watch the process memory in the Diagnostic Tools.
3.Click Add Datagrid button.
4.Repeat step 2.
5.Click Dispose button.
6.Wait for few seconds and repeat step 2.

Expected behavior

My goal is to ensure that after setting the DataGrid reference to null, the application's memory usage returns to its original level of 98MB.

Demo Sample - DataGrid_Demo.zip

Screenshots

Video reference - DataGrid_MemoryConsumption.zip

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

Windows 11 23H2 (Build 22631.3447)

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Other (specify)

Other SDK version

No response

Visual Studio Version

2022

Visual Studio Build Number

No response

Device form factor

Desktop

Nuget packages

CommunityToolkit.WinUI.UI.Controls.DataGrid Version="7.1.2"
Microsoft.WindowsAppSDK Version="1.5.240404000"
Microsoft.Windows.SDK.BuildTools Version="10.0.22621.3233"

Additional context

I am facing this issue in the older versions of the SDK too.

Help us help you

Yes, I'd like to be assigned to work on this item.

@ChidanandMurugaiah ChidanandMurugaiah added the bug 🐛 An unexpected issue that highlights incorrect behavior label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior
Projects
None yet
Development

No branches or pull requests

1 participant