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

TitleView causes memory leaks #21968

Closed
GUELIANEBelkacem opened this issue Apr 21, 2024 · 1 comment · Fixed by #22673
Closed

TitleView causes memory leaks #21968

GUELIANEBelkacem opened this issue Apr 21, 2024 · 1 comment · Fixed by #22673
Labels
area-controls-titleview TitleView delighter-sc fixed-in-8.0.60 fixed-in-9.0.0-preview.5.24307.10 memory-leak 💦 Memory usage grows / objects live forever partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with platform/android 🤖 platform/iOS 🍎 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.)
Milestone

Comments

@GUELIANEBelkacem
Copy link

Description

Adding a TitleView to any page, no matter how simple, causes a catastrophic memory leak.

In the repo i included, you'll find the basic MAUI new project with 3 test pages, one is for a simple page with a TitleView. I included in the repo a GC dump resulting from 1 navigation to/ back from the TitleView Test Page.

In order to limit the scope of this discussion i won't go into the many many many other leaks we have, i'll try to create separate bug reports and app samples whenever possible. But my god how is it possible that one small leak caused by TitleView results in the entire page, context and all child elements living forever in memory??!!!

Leaks happen, and that's fine as long as some effort goes into compartimentalisation and fault tolerance, it cannot be that 1 small leak in 1 small component could root the entire page and its object tree in memory, this just should not be! This is the real discussion. I would refer anyone insterested into #21918 (comment).

Steps to Reproduce

  1. Clone the test repo and run the project
  2. In the main page, click on Goto TitleView Test
  3. Navigate back from the test page
  4. A GC dump will confirm that the TitleViewTestPage is still in memory and is never cleared
  5. Compare the same operation with the EmptyTestPage (which is just the new navigation page "Welcome to .Net MAUI" template) where the page is cleared correctly

Link to public reproduction project repository

https://github.com/GUELIANEBelkacem/MySuperLeakyApp.git

Version with bug

8.0.10 SR3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@GUELIANEBelkacem GUELIANEBelkacem added the t/bug Something isn't working label Apr 21, 2024
@jsuarezruiz jsuarezruiz added the legacy-area-perf Startup / Runtime performance label Apr 22, 2024
@PureWeen PureWeen added the memory-leak 💦 Memory usage grows / objects live forever label Apr 22, 2024
@Zhanglirong-Winnie Zhanglirong-Winnie added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Apr 24, 2024
@Zhanglirong-Winnie
Copy link
Collaborator

Verified this issue with Visual Studio 17.10.0 Preview 4(8.0.10). Can repro on iOS and Android platforms with sample project.
https://github.com/GUELIANEBelkacem/MySuperLeakyApp.git

@Eilon Eilon added t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) area-controls-titleview TitleView and removed legacy-area-perf Startup / Runtime performance labels May 10, 2024
@jsuarezruiz jsuarezruiz added this to the Backlog milestone May 20, 2024
kubaflo added a commit to kubaflo/maui that referenced this issue May 28, 2024
rmarinho pushed a commit that referenced this issue May 28, 2024
@samhouts samhouts added the partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with label May 30, 2024
@Redth Redth modified the milestones: Backlog, .NET 8 SR6 May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-titleview TitleView delighter-sc fixed-in-8.0.60 fixed-in-9.0.0-preview.5.24307.10 memory-leak 💦 Memory usage grows / objects live forever partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with platform/android 🤖 platform/iOS 🍎 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.)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants