I am developing a windows 8 Native App. My app is getting crash after going back and forth in the application for sometime. On Analysis, using the memory profiler i found that each time i navigate from one page to another the memory usage increases inspite of me setting null all the objects of list, webclient, string and so on to null and calling GC.Collect after that on the NavigatedFrom Event.
Firstly i thought it would be due to the images and hence i removed the images from the app and tested but still there is no change in the memory usage of the app. Somehow the GC.Collect isn't working and freeing the memory.
I have tried the below mentioned things but to my bad luck isnt working to release the memory, instead the result remains the same.
I have set the image urisource to null before setting the new source and then call gc.Collect to free the memory usage but it does not seem to release it
Secondly , I have set all the objects to null, and call GC.Collect() but still it does not free up the space from the memory usage of the phone app.
I also tried to analyze using the memory profiler but I am not able to track anything.
I have also gone through all the post and implemented the suggested things but the GC.Collect() doesnt seem to release the memory.
Is there any work around for the following issue.How can i free the memory consumed on navigating from one page to another?
NavigationService.Navigateor do you sometimes useNavigationService.GoBack? A page is kept in memory as long as it's in the backstack. - Kevin Gosse