Description
On android with net8-rc.1, I'm comparing the memory usage of a CollectionView with or without IsGrouped.
When scrolling a CollectionView with IsGrouped=true, the memory usage increases infinitely.
When scrolling a CollectionView with IsGrouped=false, the memory usage is stable.
Steps to Reproduce
- Open repro project
- On the first tab, tap on
Add button, it will create a CollectionView with IsGrouped=false.
- Scroll the
CollectionView up and down. Observe memory usage with dotnet-gcdump. It is stable.
- On the second tab, tap on
Add button, it will create a CollectionView with IsGrouped=true.
- Scroll the
CollectionView up and down. Observe memory usage with dotnet-gcdump. It is slowly increasing.
- Alternatively, open the attached
gcdump files I've captured when scrolling the second tab. Between the first (memory-12.gcdump) and second (memory-19.gcdump), the size diff is +144,688 for object type List<Microsoft.Maui.Controls.Element>.
gcdump.zip

Link to public reproduction project repository
https://github.com/tranb3r/Issues/tree/main/MauiAppCollectionViewGroupingLeak
Version with bug
8.0.0-rc.1.9171
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 34
Did you find any workaround?
No workaround
Relevant log output
No response
Description
On android with
net8-rc.1, I'm comparing the memory usage of aCollectionViewwith or withoutIsGrouped.When scrolling a
CollectionViewwithIsGrouped=true, the memory usage increases infinitely.When scrolling a
CollectionViewwithIsGrouped=false, the memory usage is stable.Steps to Reproduce
Addbutton, it will create aCollectionViewwithIsGrouped=false.CollectionViewup and down. Observe memory usage withdotnet-gcdump. It is stable.Addbutton, it will create aCollectionViewwithIsGrouped=true.CollectionViewup and down. Observe memory usage withdotnet-gcdump. It is slowly increasing.gcdumpfiles I've captured when scrolling the second tab. Between the first (memory-12.gcdump) and second (memory-19.gcdump), thesize diffis+144,688for object typeList<Microsoft.Maui.Controls.Element>.gcdump.zip
Link to public reproduction project repository
https://github.com/tranb3r/Issues/tree/main/MauiAppCollectionViewGroupingLeak
Version with bug
8.0.0-rc.1.9171
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 34
Did you find any workaround?
No workaround
Relevant log output
No response