[UWP] UWP导航内存泄漏 [英] [UWP]UWP Navigation Memory Leaks

查看:202
本文介绍了[UWP] UWP导航内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我已经尝试开发UWP App,但我发现内存泄漏有很多问题,从页面切换时使用简单的项目到其他页面使用visual studio诊断程序无法释放内存。其他用户有同样的问题吗?

用于重现我准备的示例项目的问题


http://www.fasthomestore.it/UWPNavigation.zip


编译,启动项目,启动visual studio诊断,等待30分钟,内存不断增加









解决方案


您好,


请更改

NavigationCacheMode
从禁用到必需。这将确保应用程序每次导航时都不会创建页面的新实例。


喜欢这个:

  

 this.NavigationCacheMode = NavigationCacheMode.Required; 



祝你好运,


Roy



I have try to develop UWP App, but i have find many problems with memory leaks, using simple project when switch from page to other page the memory is not free using visual studio diagnostics. Other user have same problems?
for reproduce the problems i have prepared a sample project

http://www.fasthomestore.it/UWPNavigation.zip

Compile, start project, start visual studio diagnostic, wait 30 minutes, the memory increase continually

解决方案

Hi,

Please change the NavigationCacheMode from Disabled to Required. This will ensure the app not create a new instance of the page every time when navigating to it.

Like this:

this.NavigationCacheMode = NavigationCacheMode.Required;

Best regards,

Roy


这篇关于[UWP] UWP导航内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆