MAUI memory leak #31416
Unanswered
phuctran22071992
asked this question in
Q&A
MAUI memory leak
#31416
Replies: 1 comment
-
![]() Here is the gcdump heapview when I back to Login Page |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I created a simple .NET MAUI project to investigate a memory issue I’m seeing in my main project.
Problem:I registered 3 pages as absolute routes:
//Main
//Main/UserProfile
//Main/Login
Steps to reproduce:
Navigate from MainPage → Login
Navigate from Login → UserProfile
From UserProfile, navigate back → Login
Expected:The UserProfile page should be disposed and removed from memory.
Actual:When I run gcdump and check the heap view, I see the UserProfile page is still in memory.
I’ve already checked the Visual Tree, and the page is not there.
Environment:
Testing on Android device
public partial class AppShell : Shell
{
public AppShell()
{
InitializeRouting();
InitializeComponent();
}
}
public partial class MainViewModel:ObservableObject
{
public MainViewModel()
{
}
}
public partial class UserProfileViewModel : ObservableObject
{
public UserProfileViewModel()
{
}
}
https://github.com/phuctran22071992/maui-test-profile
Here is the source code:
https://github.com/phuctran22071992/maui-test-profile
Beta Was this translation helpful? Give feedback.
All reactions