-
Notifications
You must be signed in to change notification settings - Fork 106
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 during page navigation with ListViews #1213
Comments
Hi, I created a project using the starter WinUI3 template provided by Visual Studio. |
has the same problem, operation similar to yours.(also appears when navigation stack is disabled) |
Unfortunately app still leaks memory, but it seems to be a WinUI 3 deficiency as there are other examples of this: microsoft/microsoft-ui-xaml#5978 microsoft/CsWinRT#1213
Along with rendering performance issues and the consistent memory leakages. WinUI3/WinAppSdk has been performing really badly since its release. Can we expect any significant improvements in both rendering & memory? Or should we switch to web dev? |
is there any workaround for this while we wait for the fix ? I am surprise this has not been fix yet as this affects everyone using this framework. Even WinUI 2 Galery has this issue. Come on. |
We have migrated our UWP app to WinUI3/WinAppSdk and all our users are reporting a significant performance improvement, there are still memory leaks in navigation, but in our stress tests they do not appear as early as they did in UWP. This team is doing a good job but these remaining issues need to be addressed soon, the navigation memory leaks have been present on this platform since its early days. |
For now I went ahead and implemented ContentControl navigation instead of Frame navigation. Manually disposing/getting rid of UserControl (instead of pages) seems to be doing the trick for now. |
Try Windows App SDK 1.2.0-preview2, It fixes many problems. (The memory leak of listview is fixed, but I haven't tested Frame) |
@l619534951 I'm using it, it's not fixed. |
It should be fixed in the latest WindowsAppSDK version. I tested navigating back & forth and it's indeed increasing the memory but for my app it stops at around 500 MB of RAM. As far as I know there is a cache limit until which no memory will be released, so probably that's why it's still increasing. |
Yes it has been fixed. Memory does no longer increase beyond a certain threshold (I believe this is dependent on the System configuration and automatically adapts). I believe WinAppSdk is heading in the right direction with the latest improvements in rendering. But scrolling still isn't as smooth as UWP, but I believe this will be fixed in a future release. I already have a much better experience with my app using WinAppSDK than with UWP, no sudden crashes, ListView/ItemsRepeater renders are much faster etc. Well done to the team. |
I have still this issue. @christosk92 my application runs with 110mb memory usage, I have several charts and after doing some navigation and loading some charts it goes to 2gb and more. Is this |
@christosk92 Which version resolved this problem? |
@manodasanW I think this issue is not only related to ListView (maybe rename this issue?) and I also would argue it is not really fixed. Apps like Files or the WinUI Gallery still have issues with massive memory consumption. Attached is a simple repro project: NavigationMemoryLeak.zip |
@manodasanW any update? |
Find attached two demo projects, the "UIOnly" folder contains the example from this issue comment, ported to the latest project template.
Additionally, the "MVVM" folder contains an example that is similar to what I try to build in my application. I had to click back and force for a long time and some memory gets freed sometimes, but the app will crash eventually.
Hope that helps and thanks for looking into it.
PoC.zip
Originally posted by @marcpiechura in #413 (comment)
The text was updated successfully, but these errors were encountered: