-
Notifications
You must be signed in to change notification settings - Fork 1.9k
iOS PopModalAsync causes memory leaks #21453
Copy link
Copy link
Closed
Labels
area-controls-modalfixed-in-8.0.70fixed-in-9.0.0-preview.6.24327.7legacy-area-perfStartup / Runtime performanceStartup / Runtime performancemigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-ConvertXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertpartner/cat 😻this is an issue that impacts one of our partners or a customer our advisory team is engaged withthis is an issue that impacts one of our partners or a customer our advisory team is engaged withperf/generalThe issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)perf/memory-leak 💦Memory usage grows / objects live forever (sub: perf)Memory usage grows / objects live forever (sub: perf)platform/ioss/triagedIssue has been reviewedIssue has been reviewedt/bugSomething isn't workingSomething isn't working
Milestone
Metadata
Metadata
Assignees
Labels
area-controls-modalfixed-in-8.0.70fixed-in-9.0.0-preview.6.24327.7legacy-area-perfStartup / Runtime performanceStartup / Runtime performancemigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-ConvertXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertpartner/cat 😻this is an issue that impacts one of our partners or a customer our advisory team is engaged withthis is an issue that impacts one of our partners or a customer our advisory team is engaged withperf/generalThe issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)perf/memory-leak 💦Memory usage grows / objects live forever (sub: perf)Memory usage grows / objects live forever (sub: perf)platform/ioss/triagedIssue has been reviewedIssue has been reviewedt/bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Done
Description
Whne you push a modal page that is wrapped in a NavigationPage
Navigation.PushModalAsync(new NavigationPage(new ModularPage()));on iOS we can see that the Page is never released from the memory. We are using Perfiew for debugging.Here is a GCDump where we open and close a modal page multiple times
20240326_110245_0.zip
I am adding a sample which has both solutions outcommented. Seems counterintuitive that we need to call DisconnectHandler on existing pages and controls when popping a page from the Navigation stack.
NavigationSample.zip
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
8.0.6 SR1
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?
Seems that this can only be fixed by running disconnectHanler on each element on the Page including the page
or creating a custom handler for the NavigationPage and running
Relevant log output
No response