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 when pushing and poping a page many times #745

Open
2 of 7 tasks
fpuente70 opened this issue Sep 23, 2022 · 1 comment
Open
2 of 7 tasks

Memory leak when pushing and poping a page many times #745

fpuente70 opened this issue Sep 23, 2022 · 1 comment

Comments

@fpuente70
Copy link

fpuente70 commented Sep 23, 2022

🐛 Bug Report

There seems to be a memory leak in the push/pop process which can be significative after many iterations, especially on IOS.

Expected behavior

whatever is done during push/pop process should release the memory used for it to avoid memory leaks

Reproduction steps

        long memoryBefore = GC.GetTotalMemory(true);
        MyPopupPage popup = new MyPopupPage();
        for (int i = 0; i < 1000; i++)
        {
            await PopupNavigation.Instance.PushAsync(popup);
            await PopupNavigation.Instance.RemovePageAsync(popup);
        }
        GC.Collect();
        long memoryAfter = GC.GetTotalMemory(true);
        Console.WriteLine("{0:D}", memoryAfter - memoryBefore);

doing this with the base PopupPage or an empty derived class will result in no significative memory leak. However, when you start to put things on the XAML like grids, lists, labels, images, etc it starts to slowly leak memory, proportionally with the amount of elements displayed on the popup page.
The amount of memory leaked seems to be more on IOS than on Android, but they both show leaks.

Configuration

Version: 1.x
version 1.2.0.223
Platform:

  • 📱 iOS
  • 🤖 Android
  • 🏁 WPF
  • 🌎 UWP
  • 🍎 MacOS
  • 📺 tvOS
  • 🐒 Xamarin.Forms
@LennoxP90
Copy link

I may have fixed this from #762

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants