Xamarin.Forms icon indicating copy to clipboard operation
Xamarin.Forms copied to clipboard

[Bug] Memory Leak in CollectionView ?

Open govi2010 opened this issue 2 years ago • 2 comments

Hello Team,

I am new to xamarin. We are using Xamarin application with ReactiveUI implementation. Screen: We have simple screen with button to show/hide the CollectionView and API call to bind the data to CollectionView.

image

Where ever I scroll the CollectionView or click on show/hide button. More memory is consumed by app.

So After using in for 2 hours or more it will be start giving ANR on android.

I am using Xamarin Profiler to check what's going on under the hood.

What I noticed is that there are 800 students returns from the server. But on profiler I see 5000+ FileImageSource I see 5000+ Dictionary<Xamarin.Forms.BindableProperty, Xamarin.Forms.BindableObject.BindablePropertyContex> I see 5000+ System.Func<System.Reactive.Unit> I see 5000+ Xamarin.Forms.WeakEventManager.Subcription[] and Many more......

And this object get increased as I scroll or click on show/hide button.

govi2010 avatar Sep 16 '23 12:09 govi2010

DynamicDataExample.zip Sample App

govi2010 avatar Sep 16 '23 12:09 govi2010

Try .NET MAUI in .NET 8

akhanalcs avatar Sep 26 '23 21:09 akhanalcs