Information about garbage collected items
Information about garbage collected items:
Game developers often have to make their games rock-solid 60 FPS and every time GC kicks in, frames are skipped. So we end up trying to find and remove every piece of code that generates garbage.
In the past I used CLRProfiler, which gave you a list of every disposed element in a certain GC iteration. With a single click, you had a list of all the points of your code that had generated garbage and was collected in the last GC iteration. Unfortunately CLRProfiler is no more.
Current tools in VS2017 doesn't allow to do this: I can run my program and get two memory snapshots with the diagnostic tools, and compare them, and get, in example, the "count diff". But this is not what it is important, because in example, you could have the same amount of strings in the two snapshots, but have generated thousands of bytes of garbage creating ten strings each frame.
It would be very useful if you had a section where you would list the all objects that were collected in the last GC (and not only Gen1 and Gen2, but also in Gen0), or if not possible, the list of objects that were in memory in the Snapshot t1, but not in the Snapshot t0.
Nik Karpinsky commented
During VS2017 Update 8 we started work on a such a feature called the .NET Object Allocation Tracking Tool. You can find out more about it in our blog post at: https://blogs.msdn.microsoft.com/visualstudio/2018/08/14/visual-studio-2017-version-15-8/