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?
JetBrains dotTrace is equally good as ANTS. Just in case You wanted to have more choice.
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.
ANTS Performance Profiler 6.2 .NET code profiler: Speed up the performance of your .NET applications
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With