MAUI CarouselView Out Of Memory Issue.

Maui android project CarouselView out of memory issue and laggy issue, when i load too many data.
7 Replies
𝐓𝐇𝐄 𝐊𝐈𝐍𝐆𝐌𝐀𝐊𝐄𝐑
they have any free tool to trach and memory profile ? i am using rider, i can able to trace android device maui application in that.
lycian
lycian7d ago
GitHub
Profiling .NET MAUI Apps
.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop. - dotnet/maui
𝐓𝐇𝐄 𝐊𝐈𝐍𝐆𝐌𝐀𝐊𝐄𝐑
when i swipe up CarouselView, everytime heap memory size massively increasing, have any idae how to disponse the old data of the CarouselView ? i did many R&D in google but i not get any proper results.
Lyrcaxis
Lyrcaxis7d ago
don't instantiate too many videos -- just use a rotating carousel imo -- maybe preload metadata (and maybe a thumbnail for +- 3 vids), then try to always keep 3 of them "ready-to-play", while discarding the rest so maybe you should only have 3/5/7 entries at each time on the carousel, even if you have the metadata to load more, then modify the ViewModels and maybe order to change the contents.
𝐓𝐇𝐄 𝐊𝐈𝐍𝐆𝐌𝐀𝐊𝐄𝐑
yea it is a good idea, but i CarouselView ItemSource allowed only one ui element, if i use 2 ui element inside CarouselView ItemSource it is showing a error, so i can't able to loop it.
[ObservableProperty] private ObservableCollection<ReelsStatisticsItemSource> _reelsCollection;
[ObservableProperty] private ObservableCollection<ReelsStatisticsItemSource> _reelsCollection;
now i am pass the array in this ObservableCollection and loading the data inside CarouselView. when scrolling time if i remove the First() index from this collection and add new index in collection, the ui is not feel smoot like instagram reels, if is flickring when scroll. i got a idea, without removing and add data in ObservableCollection just override the data ma result be good, it think so, let me try.

Did you find this page helpful?