Finding the true memory footprint of a Windows application

前端 未结 2 445
遇见更好的自我
遇见更好的自我 2020-12-11 10:04

I\'ve run into a few OutOfMemoryExceptions with my C#/WPF application and I\'m running into some confusing data while attempting to profile the memory usage.

When t

相关标签:
2条回答
  • 2020-12-11 10:33

    Using some of the diagnostics tools suggested here, plus the ANTS memory profiler (which is so money) I found the source of the leak.

    1. WPF Storyboard animations leak under .NET 3.5
    2. The WPF BitmapEffect class can cause leaks. The alternative "Effect" class fixes the leak. Link, Link
    3. XAML Merged ResourceDictionaries can cause leak. Link, Link
    4. The "Working Set" memory footprint of an application (memory shown by task manager) is not a good indication of your process' footprint. Outside applications can influence this. Link

    The memory profiling tools helped me find that the leaks were mostly in unmanaged code, which made it a real pain to track down. Dealing with these leaks, plus a better understanding of Windows memory (private vs working set) cleared things up.

    0 讨论(0)
  • 2020-12-11 10:41

    Prcess Explorer and VMMap, both part of the Sysinternals Suite by Mark Russinovich.

    0 讨论(0)
提交回复
热议问题