Skip to content

Memory leak with CarouselView #17726

@tranb3r

Description

@tranb3r

Description

On android with net8-rc.1, when navigating to a page containing a CarouselView and then back, the memory usage grows.
For comparison, no memory leak when navigating to a page containing a CollectionView with the same ItemsSource and ItemTemplate.

Steps to Reproduce

  1. Open repro project
  2. On the first tab, tap on Go button, it will navigate to a page with a CollectionView.
  3. Go back to the main page. Repeat a few times. Observe memory usage with dotnet-gcdump. It is stable.
  4. On the second tab, tap on Go button, it will navigate to a page with a CarouselView.
  5. Go back to the main page. Repeat a few times. Observe memory usage with dotnet-gcdump. It is slowly increasing.
  6. Alternatively, open the attached gcdump files I've captured when showing the CarouselView page a few times. Between the first (memory-20.gcdump) and second (memory-24.gcdump), the memory usage increases quite a lot (the page is really simple).

gcdump.zip

Screenshot 2023-09-28 172824

Link to public reproduction project repository

https://github.com/tranb3r/Issues/tree/main/MauiAppCarouselViewLeak

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

Metadata

Metadata

Labels

area-controls-collectionviewCollectionView, CarouselView, IndicatorViewfixed-in-8.0.6Look for this fix in 8.0.6 SR1!perf/generalThe issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)perf/memory-leak 💦Memory usage grows / objects live forever (sub: perf)platform/androidt/bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions