Memory Profiler: a way to report difference on # of allocated objects of certain type between snaps

We have our own memory profiler tool written in python that imports the snapshots and then crawls the GC heap, builds a dependency graph of allocations (so that you can traverse dependency hierarchies to GC roots along the dependency chain), and finally allows you to diff memory dumps in various ways.

I was hoping that the Memory Profiler could replace this, so that I don’t have to be maintaining this tool going forward. In order for it to work well for our workflow, some things seem to be missing (or maybe I just don’t know how to get them out of the tool?):

  1. display stats counts on types of allocated objects between dumps…

say … +10 HaxorRoxor.SwissArmyKnife objects
-100 System.String objects

this for me is the number one step in starting to find memory leaks

  1. be able to traverse from object to it’s root via the full dependency chain

Is there a way to do this in the existing tool somehow or is there a plan to support such features in the future?

Cheers,
Jani

1 Like

Hello,

  1. Right now, we don’t exactly have such a display yet. What you can do is, open two snapshots, press the diff button, in the “Diff All Objects” view, click the header of the column “Type” and select “Group”, then do the same with the “Diff” Column. You can expand grouped types to see what changed.


    I do admit, that that is not an ideal way to display it. We do have some plans to improve the diff view and I’ll add a point in there to improve the way grouped data is summed up/displayed.

  2. Do you want to do the traversal in the UI or through code? For the former, as answered here , we do want add a “Path(s) to Root” Display, yes.

1 Like