Merged with What Are Some Good .NET Profilers?.
Recently I used RedGate ANTS profiler which seems pretty good, but the application I tried to profile was crashing due to DivideByException, where as running in inside Visual Studio was fine for both debug and release.
Are there other/better C# profilers that you know of?
Related
we are using Visual Studio 2013 with latest updates installed. Our solution(s) contains about 20 to 30 C# library and asp.net projects. We also have some extensions installed such as Resharper, VSCommands and NCrunch (all latest versions as well).
After working a couple of minutes on a solution the memory of Visual studio increases to more than 2GB of RAM. The IDE is becoming very unresponsive.
Usually i have to close a solution after working with it after 1 or 2 hours.
When not closing VS myself the RAM usage goes up to 3GB+ and VS crashes (probably because VS is still a 32bit application)
How can i identify what causes Visual Studio to use so much memory?
Thanks
(I realized that ncrunch is also using a lot of RAM when executing our tests. Therefor i have disabled it. It takes a couple of minutes longer for VS to use so much ram when ncrunch is disabled but the problem remains)
Ran into a similar scenario on my end. But mine was purely resharper.
I had personally used the following things to optimize the performance.
http://confluence.jetbrains.com/display/NETCOM/Ultimate+Guide+to+Speeding+Up+ReSharper+(and+Visual+Studio)
For huge projects, I usually turn off the solution wide analysis for it.
We identified that the latest perforce plugin for visual studio (p4vs: p4vs11_2014.2.93.1619.vsix) was the cause for VS to grow in memory usage.
We downgraded to p4vs11_2013.3.78.1524.vsix. This fixed the problem.
(Also it seems that p4vs11_2014.1.85.4506.vsix is still working)
I would like to know if while debugging, is possible to know how many objects of a type are loaded using a Visual Studio 2013. I am currently developing in C#.
It depends on the edition of Visual Studio you're using whether there's native support for this with a nice GUI. The .NET Memory Allocation Profiler can help you view the number of objects in memory, it ships with Visual Studio Premium and Ultimate. You can also use a more hard-core technique using Sons-of-Strike, which can give you very detailed information, should you know what to look for. SoS works with any version of Visual Studio and even with the basic WinDbg debugger. Here's an additional tutorial from the Microsoft P&P group on the subject. To get SoS you need to download and install the Windows Debugging Tools whcih you can find here.
There are a number of 3rd party profilers as well, like:
Red-Gate Ants Memory profiler
JetBrains dotTrace
Intel VTune
SciTech .NET Memory Profiler
Other similar questions on StackOverflow:
What Are Some Good .NET Profilers?
.NET Memory Profiling Tools
This is somewhat unclear.
We've been using JetBrains dotTrace Memory for memory profiling in C# before. As the latest version of it supports only .net 3.5 we are pretty stuck.
Can the visual studio profiler make memory snapshots at two distinct times and display the difference?
I am trying to pin down some memory leaks and I seem unable to get close to what causes them
I've read the post about profiling here: http://blogs.msdn.com/b/dotnet/archive/2013/04/04/net-memory-allocation-profiling-with-visual-studio-2012.aspx and it states you can make snapshots however I cannot find this feature in the professional version of Visual Studio.
Visual Studio 2010 Professional Edition doesn't contain the profiler. http://www.microsoft.com/visualstudio/en-us/products/2010-editions/product-comparison
What free alternatives are there?
It looks like MS has provided a stand alone tool that you can use
EQATEC Profile is the only free one that I'm aware of, but I've never used it. http://www.eqatec.com/tools/profiler/
I've personally had great success with JetBrains' dotTrace profiler in the past. http://www.jetbrains.com/profiler/
RedGate also has their ANTS Performance Profiler product. http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/
Neither of these are free, although usually the trial period is enough to diagnose a few problems to work on for awhile. :)
AQtime: http://smartbear.com/products/free-tools/aqtime-standard/
Another good alternative is the built in profiler that comes with SharpDevelop: http://www.icsharpcode.net/opensource/sd/
How to profile a WPF application? I am a beginner C# developer, so I'm sure I would have made some mistakes/bad practices which I should alteast catch by profiling.
Is there a way I can see stack call of all the methods(only ones coded by me, not .NET library functions) and the duration of execution of each method?
Visual Studio includes a great profiling tool:
http://msdn.microsoft.com/en-us/library/z9z62c29.aspx
Another popular profiler for .NET is RedGate ANTS:
http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/
I've found RedGate ANTS easier to setup and use, but in the long run, I had better results with Visual Studio's profiler.
You can see time spent in just your methods, time spent in all methods, CPU time vs Wall time, and other useful metrics.
Just glancing around, this looks like a pretty good tutorial on the profiling tools of Visual Studio: http://www.geekzone.co.nz/vs2008/6265
It's for Visual Studio 2008, but it's the same concepts if you are using VS2010.
Beyond that, your probably need to ask something more specific.
As part of the SDK for Win7 .NET4 there is a profiler tool
"The WPF Performance Suite enables you to analyze the run-time behavior of your WPF applications and determine performance optimizations that you can apply. The WPF Performance Suite includes performance profiling tools called Perforator and Visual Profiler"
http://msdn.microsoft.com/en-us/library/aa969767.aspx