Deleting project/pages/usercontrols from memory

前端 未结 3 1330
滥情空心
滥情空心 2021-02-18 16:10

I have made a windows phone app, that unfortunately has some memory leak, because pages are not removed correctly. This was solved by using the answer:

Remove Pages wind

3条回答
  •  清歌不尽
    2021-02-18 16:31

    Beware of third party controls/libraries, Image, LongListSelector, FlipView or WebView, because they have some issues with memory management.

    You should make sure, that no threads/tasks/timers keep reference to your Views/ViewModels.

    There are two interesting articles about memory leaks:

    • Memory Leaks in WPF applications
    • Managing Memory in Windows Store Apps

    I guess it will be hard to find the root cause without any sample project. If it doesn't occur in empty project with the same architecture, then there is some issue in your code.

提交回复
热议问题