How is a .net garbage collector profile?

I would like to know how to profile the performance of the garbage collector and track three generations. I wonder if it is possible at any time to find out what current objects live in gen0,gen1,gen2 .

+3
garbage-collection
source share
3 answers

You can get useful GC performance information from PerfMon - not as detailed as you want.

There are a lot of memory performance. NET Counters, and this should give you some guidelines for interpreting counter data and how to relate them. This assumes that you have a basic understanding of GC.

If you have one of the premium versions of Visual Studio that includes Performance / Profiling Tools , you can get more information about individual object distributions and lifetimes. In particular, this may be in the area that you wish:

The garbage collector restores memory by freeing up a whole generation of objects. For objects that are profiled, the application is created, an object. The "Lifetime" view displays the number and size of objects and the generation when they return.

If you feel very adventurous, you can perform custom profiling using the profiling API .

+5
source share

The CLR profiler could do this , but I don’t think it is being actively updated, i.e. for 3.5, 4.0, for 2.0 target applications, you can do this with the associated version.

+1
source share

Check out JetBrains DotTrace.

+1
source share

All Articles