.NET Memory Profiling Tools [duplicate]
Asked Answered
S

9

54

Possible Duplicate:
What Are Some Good .NET Profilers?

I am on the lookout for good .NET CLR memory profiling tools.

My key requirement is that it will play well with IIS and standalone CLR Apps. Ideally I would see what objects are allocated, where they are allocated and what size they are?

Does anyone have any good experiences with a particular tool that you would be happy to recommend?

Synergistic answered 30/12, 2008 at 9:20 Comment(2)
DOn't close a question as a dupe withotu adding a link to the live question it's a dupe of... just searching ".NET Memory Profiling"Effusion
Not a duplicate. The other question is about "profilers" which indicates a focus on performance. This question is about "memory profiling". There will likely be some overlap in the tools, but it is definitely a different question.Maturate
G
45

I'm currently evaluating both the Scitech .NET Memory Profiler 3.1 and ANTS Memory Profiler 5.1. I tried the JetBrains one a year or two ago and it wasn't as good as ANTS so I haven't bothered this time. From reading the web sites it looks like it isn't as good for memory profiling as the other two.

Both ANTS and the Scitech memory profiler have features that the other doesn't, so which is best will depend upon your preferences. Generally speaking, the Scitech one provides more detailed information while the ANTS one is really incredible at identifying the leaking object. Overall, I prefer the ANTS one because it is so quick at identifying possible leaks.

Here are the main the pros and cons of each from my experience:

Common Features of ANTS and Scitech .NET Memory Profiler

  • Real-time analysis feature
  • Excellent how-to videos on their web sites
  • Easy to use
  • Reasonably performant (obviously slower than without the profiler attached, but not so much you become frustrated)
  • Show instances of leaking objects
  • Basically they both do the job pretty well

ANTS

  • One-click filters to find common leaks including: objects kept alive only by event handlers, objects that are disposed but still live and objects that are only being kept alive by a reference from a disposed object. This is probably the killer feature of ANTS - finding leaks is incredibly fast because of this. In my experience, the majority of leaks are caused by event handlers not being unhooked and ANTS just takes you straight to these objects. Awesome.
  • Object retention graph. While the same info is available in Scitech, it's much easier to interpret in ANTS.
  • Shows size with children in addition to size of the object itself (but only when an instance is selected unfortunately, not in the overall class list).
  • Better integration to Visual Studio (right-click on graph to jump to file)

Scitech .NET Memory Profiler

  • Shows stack trace when object was allocated. This is really useful for objects that are allocated in lots of different places. With ANTS it is difficult to determine exactly where the leaked object was created.
  • Shows count of disposable objects that were not disposed. While not indicative of a leak, it does identify opportunities to fix this problem and improve your application performance as a result of faster garbage collection.
  • More detailed filtering options (several columns can be filtered independently).
  • Presents info on total objects created (including those garbage collected). ANTS only shows 'live' object stats. This makes it easier to analyze and tune overall application performance (eg. identify where lots of objects being created unnecessarily that aren't necessarily leaking).

By way of summary, I think ANTS helps you find what's leaking faster while Scitech provides a bit more detail about your overall application memory performance and individual objects once you know what to look at (eg. stack trace on creation). If the stack trace and tracking of undisposed disposable objects was added to ANTS I wouldn't see the need to use anything else.

Groves answered 25/9, 2009 at 2:55 Comment(0)
P
32

Strange that CLR Profiler isn't mentioned here yet. It's free and works well.

Beware of the multiple old versions available from Microsoft's own site. As of Nov 2011, the latest version appears to be this one: latest version (alternate link)

Probationer answered 16/6, 2011 at 12:50 Comment(1)
Seems that the Project is hosted on codeplex now, along with the latest download: clrprofiler.codeplex.comShurlocke
P
8

If you're feeling really desperate, you can use WinDbg with the Son-of-Strike library (SOS.DLL) that ships with the .Net framework.

Poundage answered 25/9, 2009 at 2:59 Comment(1)
actually, this is far more useful for really obscure memory issues, such as when you're holding a reference in a non-obvious placeChrysoberyl
F
6

Big fan of JetBrains Profiler myself

Fevre answered 30/12, 2008 at 9:26 Comment(0)
I
5

.Net Memory Profiler helped me a lot on my previous project. It's not free but it's very good.

.NET Memory Profiler is a powerful tool for finding memory leaks and optimizing the memory usage in programs written in C#, VB.NET or any other .NET Language.

Intersection answered 30/12, 2008 at 9:23 Comment(0)
D
5

I second ANTS profiler.

Beside showing all you need, it will draw simple graph where you can see what takes longest to execute, and what eats memory. When you click on graphp it will show you the coresponding line in your code.

And I like litle progress bars drown on code lines which take too long to execute.

Dichy answered 30/12, 2008 at 11:25 Comment(0)
P
4

I'm currently using ANTS Profiler. It's a very good tool with many profiling detail options and plays well with stand-alone applications, development server and IIS.

Prothalamium answered 30/12, 2008 at 9:47 Comment(0)
G
4

Since everyone's listing the available tools, I thought I'd point you to the complete list of profilers for .NET: http://sharptoolbox.com/categories/profilers-debuggers

You'll find there the tools suggested here and all the other ones, each with a short description of what it proposes.

Gateway answered 23/10, 2009 at 9:12 Comment(0)
M
1

I have used Aqtime with great success over the years. I tried ANTS and others but went back to Aqtime as I also do a lot of development in unmanaged code.

Manifestative answered 3/1, 2009 at 12:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.