You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
WinUI 3 DataGrid: Uses insane amounts of memory within StackPanel #5000
I am using a DataGrid with 10k objects, containing only simple strings and integers, and memory consumption jumps from a base level of 200MB to a whopping 2GB+ consumption, I have not actually tested the upper bound, I kill the app beforehand.
This also happens for Expanders, and I suspect the issue comes from the DataGrid having to compute width / height for a dynamically sized component.
When putting the DataGrid into a fixed sized parent the issue seems to disappear, tested it on a Grid component with auto sized columns and rows, where the bug persisted, and on fixed size columns and rows where the bug disappeared.
Hope this helps anyone stuck on the same issue.
Edit:
The issue can also be resolved by setting height/width of the DataGrid itself, even in a parent with no fixed size. Tested on DataGrid with auto-sized rows and colomns.
Activity
madsbyriel commentedon Mar 28, 2025
I have a similar issue.
I am using a DataGrid with 10k objects, containing only simple strings and integers, and memory consumption jumps from a base level of 200MB to a whopping 2GB+ consumption, I have not actually tested the upper bound, I kill the app beforehand.
This also happens for Expanders, and I suspect the issue comes from the DataGrid having to compute width / height for a dynamically sized component.
When putting the DataGrid into a fixed sized parent the issue seems to disappear, tested it on a Grid component with auto sized columns and rows, where the bug persisted, and on fixed size columns and rows where the bug disappeared.
Hope this helps anyone stuck on the same issue.
Edit:
The issue can also be resolved by setting height/width of the DataGrid itself, even in a parent with no fixed size. Tested on DataGrid with auto-sized rows and colomns.