dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.04k stars 1.73k forks source link

CollectionView Header and Footer leak memory on iOS #22910

Open EGoverde opened 3 months ago

EGoverde commented 3 months ago

Description

Content placed in a CollectionView.Header or CollectionView.Footer does not get garbage collected on iOS. This is not happening on Android or WinUI. Tested using nightly '8.0.60-ci.net8.24304.1'.

The non-nightly version MAUI 8 has more memory-related issues with CollectionView that have been partially resolved in the nightly (see https://github.com/dotnet/maui/issues/20710), but this one still remains.

I created a demo project using MemoryToolkit.Maui.

Steps to Reproduce

  1. Create a Page with a CollectionView in XAML.
  2. Define a CollectionView.Header or CollectionView.Footer with any XAML (like a Label).
  3. Navigate to and then away from the Page.
  4. The content inside the Header or Footer does not get finalized.

`

` ### Link to public reproduction project repository https://github.com/EGoverde/MemoryLeaks ### Version with bug Nightly / CI build (Please specify exact version) ### Is this a regression from previous behavior? Yes, this used to work in Xamarin.Forms ### Last version that worked well Unknown/Other ### Affected platforms iOS ### Affected platform versions _No response_ ### Did you find any workaround? _No response_ ### Relevant log output _No response_
github-actions[bot] commented 3 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

RoiChen001 commented 3 months ago

Can repro this issue at iOS platform on the latest 17.11.0 Preview 2.0(8.0.60-ci.net8.24304.1&8.0.60-ci.net8.24303.1). Leak