Is Intellitrace useful for investigation undesired memory/cpu usage issues in production envrionment

348 Views Asked by At

I am hearing a lot about these new capabilities of investigating cpu and memory issues using new Diagnostics Tools in Visual Studio 2015 and Intellitrace. Let's say I need to troubleshoot a high memory or cpu problem in a production environment. I know that I can collect iTrace files from the production environment but is it something that could be useful at all to determine cause of high memory/cpu? So far, all uses case I have seen for Intellitrace are related to undesired behavious like exceptions etc but I would like to see any tutorial for using intellitrace for production memory/cpu problems.

3

There are 3 best solutions below

0
On BEST ANSWER

It is true that you can use Standalone Collector to record IntelliTrace logs in a production environment. However, these logs will not contain any information about CPU/memory usage (actually iTrace files contain only information about method calls).

It means that if you open iTrace file recorded in the production environment in Visual Studio you will see only the list of recorded diagnostic events and the call tree (if IntelliTrace was configured to collect call information). Diagnostic Tool window will not be available. If you try to open it then the following error message will be reported:

The Diagnostic Tools window does not support the current debugging configuration.

If you want to use Visual Studio 2015 Diagnostic Tools to analyse CPU/Memory usage in production you may be interested in Using the Profiling Tools from Command-line. However, I haven't tried this approach so I don't know if it is convenient. The second problem might be licensing. I'm not sure if these command line tools can be used without installing VS.

2
On

I'd recommend to establish remote debugging for a target machine with production environment. You do not need to install Visual Studio on target but you'll need to install Remote Tools. While debugging you can use CPU Usage and Memory Usage tools.

In addition to this answer I'd add that: 1) Using the Profiling Tools from Command-line refers to command line interface for Performance Wizard tool in Performance and Diagnostics Hub and CPU Usage and Memory Usage tools do not have command line interface for now; 2) you do not need to install Visual Studio IDE to use Profiling Tools from command line.

0
On

You could build a diagnostic thread into the app to monitor for abnormal behavior and do couple limited dumps without stopping operations.

It is possible to create dummy method that does nothing that you run inside the suspect code and give it some string or int parameters. These will get captured into the IntelliTrace so you can track perf,cpu etc values etc in the intellitrace log.