Memory Management App Store

Note that when you go to a page more than 200 times with Frame.Navigate(Type)memory for the application process continues to grow to a huge amount. The page starts to become sluggish when the process reaches 100 MB, which is about 50 clicks.

From what I can say, the page is created every time it moves (the page constructor will suffer). Despite the fact that this page is quite small, the application can grow up to ~ 1 GB of memory.

Obviously, the user will not be moved to the same page 200 times, but this application is durable and there are many pages, so I'm really worried about this problem.

Are there any methods to prevent this memory growth?

+4
source share
1 answer

Please make sure that you use the many “Use” instructions in your code and also use buttons Page_Unloadedor OnNavigatedFrom(NavigationEventArgs e) events to clear all heavy objects and other resources that you use on your pages.

Or, if you can convert your application to the MVVM model, the page usually caches itself and consumes less memory.

0
source

All Articles