Jamby
Jamby

Reputation: 1917

Visual Studio profiler uses huge amount of RAM

I'm trying to do an Instrumentation Profiling of a quite big project (around 40'000 source files in the whole solution, but the project under profiling has around 200 source files), written in C++.

Each time I run the profiling, it creates a huge report of around 34GB, and then, when it's going to analyze it, it's trying (I think) to load the whole file into RAM.

Obviously, it renders the computer unusable, and I have to stop the analyzer before it completes.

Any suggestions?

Upvotes: 2

Views: 1230

Answers (3)

Andre Hamilton
Andre Hamilton

Reputation: 246

Hi there hope this response isn't too late. This is Andre Hamilton from Visual Studio profiler team. Analyzing such a large report file does take some time. Instrumentation produces that much data because all of your functions are instrumented. By instrumenting a few functions or specific binary you might be able to speed things up if you don't mind profiling via the command line. This will product a vsp file which you can then open in VS and use as normal. Lets say that your project requires n binaries to run. Let us assume that of these binaries you are interested in the performance of binary ni

Open up a VisualStudio command prompt 1) Do vsinstr ni.dllto instrument the entire binary or use the /include or /exclude options of vsinstr to further restrict which functions are instrumented. N.B if your binary was signed, you will need to resign after instrumenting

2)Start the profiler in instrumentation mode via the given command vsperf /start:trace /output:myinstrumentedtrace.vsp

3)Launch Your Application

4)When you are ready to stop profiling vsperf /shutdown

Hope this helps

(Notice, I assume you have a licensed copy of VS to both collect and analyze the data).

Upvotes: 6

Paul Michalik
Paul Michalik

Reputation: 4381

This is a general problem when profiling large or "dense" programs. You need to restrict the profiler to collect data only from certain units of your code base. In Microsoft's profilers this is done by using Include/Exclude switches either at command line or in the IDE.

Upvotes: 1

Saqlain
Saqlain

Reputation: 17918

There is a bug in VS, the reason is most of the profiling work is done in UI thread it make the VS unusable, as mentioned in http://channel9.msdn.com/Forums/TechOff/260091-Visual-Studio-Performance-Analysis-in-10-minutes

You may give try to VS 2012 to see if the problem is resolved, but there is no doubt loading a 34 GB file is not a simple task and its also the reason behind resulting in system unusable, so as John suggested above in comment section, break your code in smaller component and then do profiling, hope it help!

Upvotes: 0

Related Questions