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 Leak on Page Navigation while removing the page. #21403

Closed
thanigaiharan opened this issue Mar 23, 2024 · 2 comments
Closed

Memory Leak on Page Navigation while removing the page. #21403

thanigaiharan opened this issue Mar 23, 2024 · 2 comments
Labels
area-navigation NavigationPage memory-leak 💦 Memory usage grows / objects live forever (sub: perf) platform/android 🤖 s/needs-repro Attach a solution or code which reproduces the issue t/bug Something isn't working

Comments

@thanigaiharan
Copy link

Description

In our application Performance degradation when navigating to a page and going back several times and also the memory keeps on increasing which leads to app crash.
we have lots of CollectionViews and complex master-details with multiple views, data forms and custom controls.

  1. Memory Leak on Page navigation where we will remove the Page :
Screenshot 2024-03-22 at 10 26 13 AM

 we have Fleets page where we show list of fleets in collection view. (Binding have been done in the backend .cs File of XAML).
 In the same page we have Home Icon which helps to navigate to the another page ( FleetsHome Page) .
 When navigating to the FleetsHome page we will Application.Current.MainPage.Navigation.RemovePage(FleetsPage) since we wont navigate Back to Fleets Page.
 Here When we continuolsy Navigating between pages this the the app memory increases on each navigation.

Question :

  1. By Right when we call Application.Current.MainPage.Navigation.RemovePage(FleetsPage) , it should dispose the controls and resources of FleetsPage?
  2. How Do we need to ensure the Page is disposed properly?

Steps to Reproduce

  1. Create the .NET MAUI PROJ with 2 Pages (Register the ViewModel as AddTransient)
  2. Navigate Page 1 -> Page 2 -> Page 1 (Using RemovePage() and Not Back navigation) -> Page 2. (Keep on Navigating to see memory can )

Link to public reproduction project repository

No response

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

@thanigaiharan thanigaiharan added the t/bug Something isn't working label Mar 23, 2024
@rmarinho rmarinho added platform/android 🤖 s/needs-repro Attach a solution or code which reproduces the issue memory-leak 💦 Memory usage grows / objects live forever (sub: perf) labels Mar 25, 2024
Copy link
Contributor

Hi @thanigaiharan. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@Eilon Eilon added the area-navigation NavigationPage label Mar 29, 2024
@dotnet-policy-service dotnet-policy-service bot added the s/no-recent-activity Issue has had no recent activity label Apr 3, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback to reproduce the issue but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

@github-actions github-actions bot locked and limited conversation to collaborators May 9, 2024
@dotnet-policy-service dotnet-policy-service bot removed the s/no-recent-activity Issue has had no recent activity label May 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-navigation NavigationPage memory-leak 💦 Memory usage grows / objects live forever (sub: perf) platform/android 🤖 s/needs-repro Attach a solution or code which reproduces the issue t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants