2

I am using the Memory Usage analysis tool from the Performance and Diagnostics tool (Alt + F2) in Visual Studio Ultimate 2013 Update 4. My project is written using unmanaged C++.

During a memory profiling session, I am really hoping to have Visual Studio trigger several breakpoints which I have set. These breakpoints are triggered just fine whenever I run the program without the profiler, but under the exact same conditions during profiling, they are not triggered.

Is there a way to run the memory profiler with breakpoints?

Note: I know I could use application lifecycle marks or user marks to have them show up in the profiler graph. However, the breakpoints will be far more helpful to root out an issue by stepping through the code whenever I see a change in the memory usage.

enter image description here

Oliver Spryn
  • 16,871
  • 33
  • 101
  • 195
  • 1
    From http://blogs.msdn.com/b/visualstudioalm/archive/2014/11/13/memory-usage-tool-while-debugging-in-visual-studio-2015.aspx, no it's not possible unfortunately... – Alfredo Gimenez Apr 02 '15 at 18:49
  • 1
    One possible reason for this is that profilers gather information at periodic intervals of execution, so if you break or modify the execution, that information gets corrupted. A possible solution is to use platform-specific API functions to dump memory information into a variable at runtime, see http://stackoverflow.com/questions/63166/how-to-determine-cpu-and-memory-consumption-from-inside-a-process – Alfredo Gimenez Apr 02 '15 at 18:51
  • @spiffman That's what I was afraid of. Thank you for your helpful links. – Oliver Spryn Apr 02 '15 at 20:11
  • Do you know how to actually set a user mark in native C++? All I can find is .net or C++ CLR. – Samuel Feb 17 '17 at 07:45

0 Answers0