简体   繁体   English

WP7应用程序上的内存消耗非常高

[英]Memory Consumtion is very highy on wp7 app

I am testing my wp7 app and it taking 85MB on Peak memory that is very near to 90MB Limit by Microsoft. 我正在测试我的wp7应用程序,它在Peak内存上占用了85MB,这非常接近Microsoft的90MB限制。 How I can reduce that memory consummation. 我如何减少内存消耗。

In my application. 在我的应用程序中。 I have one panorama page and 3 4 other pages. 我有一个全景页面,还有3 4个其他页面。 On panorama page I am loading contacts and showing in my long-list selector. 在全景页面上,我正在加载联系人并显示在我的长列表选择器中。 I checked on profile it showing some warnings on Navigation. 我检查了配置文件,在导航上显示了一些警告。 How To Catter That. 如何做到这一点。 What is Best Practices in That Scenario. 什么是该方案中的最佳实践。

=== UPDATE === ===更新===

  1. Should I Empty My Listbox Mean Assign Null As Itemsource on OnNavigatedFrom Event 我应该清空我的列表框的意思是在OnNavigatedFrom事件上将Null分配为Itemsource吗?

  2. Call GC.Collect() On OnNavigatedFrom Event 在OnNavigatedFrom事件中调用GC.Collect()

  3. In the OnNavigatedTo, I manually calls NavigateService.RemoveBackEntry() to remove the page from backstack and then call GC.Collect() 在OnNavigatedTo中,我手动调用NavigateService.RemoveBackEntry()从后堆栈中删除页面,然后调用GC.Collect()

这里有一些技巧,从技巧5可能对您来说很有趣。

Click here for read a good article to explain lot off good practices for windows phone. 单击此处以阅读一篇好文章,以解释Windows Phone的许多优良作法。 (for limit memory usage too ^^) (也用于限制内存使用^^)

I have found that using a Panorama is extremely expensive memory-wise and ended up switching to a Pivot. 我发现在内存方面使用Panorama极其昂贵,最终切换到Pivot。 If you have that option, it may be your best bet. 如果您有这种选择,那可能是您最好的选择。 Not sure if there are any real answers here, but here is a thread where this issue is discussed. 不知道这里是否有任何实际的答案,但是这里有一个讨论此问题的话题。

Panorama Memory Usage 全景记忆体使用量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM