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

Leaking pages on navigation #19677

Open
c-ramarin opened this issue Mar 13, 2025 · 1 comment
Open

Leaking pages on navigation #19677

c-ramarin opened this issue Mar 13, 2025 · 1 comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification

Comments

@c-ramarin
Copy link

c-ramarin commented Mar 13, 2025

Current behavior

On Android device/emulator, when navigating HomePage -> Page1 and then back to HomePage, then calling GC.Collect (called automatically by HomePage), a reference remains to Page1

Expected behavior

When navigating HomePage -> Page1 and then back to HomePage, then calling GC.Collect, there should be no reference to Page1 and all it's related resources released

How to reproduce it (as minimally and precisely as possible)

UnoAppTest.zip

1- Run app on Android device or emulator in debug mode.
2- Watch the output window in your IDE, notice the Inactive/active DependencyObject references counts
3- navigate to page 1, then page 2, then page 3
4- navigate back to the home page (trigger GC.Collect)
5- notice the IDE output window
6- Reference count = 1 remains for most visited pages (search Page1, Page2, Page3)

Image

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

Android

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@c-ramarin c-ramarin added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Mar 13, 2025
@airtaxi
Copy link

airtaxi commented Mar 15, 2025

Could you check this article:
https://platform.uno/docs/articles/features/native-frame-nav.html#platform-specifics

Android: On mobile, the pages in the back stack are still preserved in the visual tree for performance reasons. This feature can be disabled on Android by setting Uno.UI.FeatureConfiguration.NativeFramePresenter.AndroidUnloadInactivePages = true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

No branches or pull requests

2 participants