Thanks to visit codestin.com
Credit goes to github.com

Skip to content

CollectionView with many items (10,000+) hangs or crashes on iOS #18891

@activa

Description

@activa

Description

A simple CollectionView with a lot of items (100,000 or so) will hang on Windows and iOS. Memory consumption goes through the roof (gigabytes of allocations) and will eventually even crash on iOS.
On Android this seems to work without any issues.

It's extremely easy to reproduce. Simply create a blank application and add this CollectionView to the page:

<CollectionView x:Name="listview"/>

Bind 100,000 strings to the collection view and watch it hang on startup. Running in a debugger shows the memory usage going up to gigabytes.

Steps to Reproduce

  1. Create a new MAUI app
  2. Add a CollectionView to the main page with or without an ItemTemplate
  3. Bind 100,000 strings to the CollectionView
  4. Run

Link to public reproduction project repository

https://github.com/activa/Maui8CollectionViewBug

Version with bug

8.0.3

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-collectionviewCollectionView, CarouselView, IndicatorViewmigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertperf/generalThe issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)platform/iosplatform/windowss/needs-attentionIssue has more information and needs another lookt/bugSomething isn't working

    Type

    No type

    Projects

    Status

    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions