Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which memory profiler will tell me what is collected in each generation?

Tags:

c#

.net

memory

I've recently become curious about exactly which objects are collected in which generation. It's been a while since I last used a profiler, which I think was SciTech. I don't recall it showing a breakdown of collections sorted by generation number, but I may be wrong.

Before I go and install a whole bunch of profilers, does anyone have a recommendation?

like image 974
Carlos Avatar asked Jun 07 '11 08:06

Carlos


4 Answers

JetBrains dotTrace is equally good as ANTS. Just in case You wanted to have more choice.

like image 193
Wojtek Turowicz Avatar answered Nov 16 '22 19:11

Wojtek Turowicz


You can use WinDbg. There's an extension called SOSex (SOSEX) which extends the basic commands provided by the standard SOS.DLL debugger extension.

Specifically, it has a command, !dumpgen, that dumps the contents of the specified generation.

Also, with SOS !FindRoots you can set a breakpoint when the GC is about to collect a generation.

like image 25
Haplo Avatar answered Nov 16 '22 18:11

Haplo


ANTS Performance Profiler 6.2 .NET code profiler: Speed up the performance of your .NET applications

like image 1
Pranay Rana Avatar answered Nov 16 '22 18:11

Pranay Rana


I use ANTS - it's made up of 2 separate profilers, a performance one and a memory one. You'd need to use ANTS Memory Profiler to look at object collection. That definitely lets you examine different generations separately.

like image 1
Simon Smith Avatar answered Nov 16 '22 19:11

Simon Smith