Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory usage increases when scrolling collectionview if resources count is more than 191 #22053

Open
tranb3r opened this issue Apr 25, 2024 · 4 comments
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView memory-leak 💦 Memory usage grows / objects live forever (sub: perf) platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)
Milestone

Comments

@tranb3r
Copy link

tranb3r commented Apr 25, 2024

Description

I have a simple maui application for android with a collectionview and several static resources.
The collectionview is NOT using the static resources.
Here is a strange behavior that happens when scrolling the collectionview:

  • when the resources count is LESS than 190, the memory usage is stable. This is expected.
  • when the resources count is MORE than 191, the memory usage increases. Isn't it weird?

It's very easy to reproduce. Same behavior for both Debug and Release.

ok.webm
ko.webm

Steps to Reproduce

  1. Open repro and launch the app on android emulator (Pixel 5).
  2. The resources count should be 191. Scroll the collectionView. Memory usage increases.
  3. Reset memory by clicking the GC button. Memory goes back to its inital value.
  4. Decrease the resources count to 190. Scroll the collectionView. Memory usage is stable.

Link to public reproduction project repository

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

Version with bug

8.0.21 SR4.1

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

No response

Did you find any workaround?

No workaround.

Relevant log output

No response

@tranb3r tranb3r added the t/bug Something isn't working label Apr 25, 2024
@jsuarezruiz jsuarezruiz added legacy-area-perf Startup / Runtime performance area-controls-collectionview CollectionView, CarouselView, IndicatorView labels Apr 25, 2024
@kevinxufei kevinxufei added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Apr 26, 2024
@kevinxufei
Copy link

kevinxufei commented Apr 26, 2024

Can repro this issue at Android platform at the latest 17.10 Preview 5 (8.0.3/8.0.21), and a smaller resources count also results in an increase in memory usage.

@tranb3r
Copy link
Author

tranb3r commented Apr 26, 2024

@kevinxufei
I'm suprised you also get the issue with only 90 resources.
Did you run the app in Release? In Debug, you'd have to disable HotReload.

@kevinxufei
Copy link

The previous result did not disable 'HotReload'. If resources count>190, memory usage increases. If resources count<190, memory usage is stable.Thanks for reminding!

@PureWeen PureWeen added the memory-leak 💦 Memory usage grows / objects live forever (sub: perf) label Apr 28, 2024
@PureWeen PureWeen added this to the Backlog milestone Apr 28, 2024
@Eilon Eilon added t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf) and removed legacy-area-perf Startup / Runtime performance labels May 10, 2024
@samhouts samhouts removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 3, 2024
@samhouts samhouts added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 10, 2024
@tranb3r
Copy link
Author

tranb3r commented Dec 2, 2024

Still happening with maui 9.0.10 and dotnet-android 35.0.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView memory-leak 💦 Memory usage grows / objects live forever (sub: perf) platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)
Projects
None yet
Development

No branches or pull requests

6 participants