Memory leak with Shell Navigation #22313
Labels
area-controls-shell
Shell Navigation, Routes, Tabs, Flyout
memory-leak 💦
Memory usage grows / objects live forever
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
Description
With Maui Shell Navigation, we could see some page are not disposed properly when we are not using them as Routed page.
In provided sample, we have 3 Shell Pages, in which Main Page & First Page is not registered as routed page. Second Page is added as routed Page. After Navigating through these page, only MainPage & FirstPage is not releasing its object, like Second Page.
Note: We are using memory toolkit to monitor the memory leaks. Reference : https://github.com/AdamEssenmacher/MemoryToolkit.Maui?tab=readme-ov-file
Steps to Reproduce
We can see, objects of Second Page will be released properly, not with First and Main page.
Link to public reproduction project repository
Replication Sample
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
8.0.0-rc.1.9171
Affected platforms
iOS, Android
Affected platform versions
Android 13, iOS 15.0
Did you find any workaround?
Registering Route for Affected pages in AppShell.Xaml.cs, resolves the issue.
Relevant log output
The text was updated successfully, but these errors were encountered: