CLR Profiler - Highlights , Lowlights

Overview

CLRProfiler is a tool that you can use to analyze the behavior of your managed applications. Like any such tool, it has specific strengths and weaknesses.

Highlights

  1. CLRProfiler is a tool that is focused on analyzing what is going on in the garbage collector heap:

    • Which methods allocate which types of objects?
    • Which objects survive?
    • What is on the heap?
    • What keeps objects alive?
       
  2. Additionally

    • The call graph feature lets you see who is calling whom how often.
    • Which methods, classes, modules get pulled in by whom
  3. The tool can profile applications, services, and ASP.NET pages.
  4. The profiled application can control profiling:

    • You can add comments that can also serve as time markers.
    • You can turn allocation and call logging on or off.
    • You can trigger a heap dump.
       
  5. The log files produced are self-contained – you do not need to save symbol files and the like to later analyze the log file.
  6. There is also a command-line interface allowing log files to be produced in batch mode, and allowing you to produce text file reports.

Lowlights

  • CLRProfiler should not run in Production servers. This will cause the performance and slow down the application.
  • It's should run in QA/UAT servers to get the performance / GC results.
  • CLRProfiler is an intrusive tool; seeing a 10 to 100x slowdown in the application being profiled is not unusual. Therefore, it is not the right tool to find out where time is spent – use other profilers for that.
  • Log files can get huge. By default, every allocation and every call is logged, which can consume gigabytes of disk space. However, allocation and call logging can be turned on and off selectively either by the application or in the CLRProfiler UI.
  • CLRProfiler cannot “attach” to an application that is already running.