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?
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.