I have a WPF application, that is sometimes freezing for maybe a half minute and then works fine. I am thinking to profile that application. Anybody knows a good tutorial of how to profile WPF application? Or anybody has any idea on finding a way to know when it is freezing? The freezing is not consistent, and not related to any usage pattern
Thanks for help.
Ghassan
A profiler is a tool that monitors the execution of another application. A common language runtime (CLR) profiler is a dynamic link library (DLL) that consists of functions that receive messages from, and send messages to, the CLR by using the profiling API. The profiler DLL is loaded by the CLR at run time.
You can use profiling tools to identify which portions of the program are executed most frequently or where most of the time is spent. Profiling tools are typically used after a basic tool, such as the vmstat or iostat commands, shows that a CPU bottleneck is causing a performance problem.
Open the Performance Profiler by choosing Debug > Performance Profiler (or Alt + F2). For more information on using the CPU Usage or Memory usage tool in the Performance Profiler vs. the debugger-integrated tools, see Run profiling tools with or without the debugger.
When you start debugging in Visual Studio by selecting Debug > Start Debugging, or pressing F5, the Diagnostic Tools window appears by default. To open it manually, select Debug > Windows > Show Diagnostic Tools. The Diagnostic Tools window shows information about events, process memory, and CPU usage.
There is a toolset in the Windows SDK called WPFPerf - it has a set of tools (like Perforator) that help specifically with WPF debugging and profiling. Here's a quick guide on these tools.
For general .net profiling, RedGate Ants or JetBrains' dotTrace are great. There is also some profiling included in Visual Studio 2005/2008 (and better ones in 2010?).
Profiling is overkill. During that half minute, it's waiting for something. Just pause it and see what it's waiting for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With