Display heap snapshot as a flame graph

Teo Camarasu
2024-02-21T16:39:12Z

Flamegraphs offer a nice graphical way to visualise retention/heap size information.
This is something that Java apparently has. See: https://perfetto.dev/docs/data-sources/java-heap-profiler

Formally, we do a breadth first traversal of the heap starting from the GC roots. For each closure, this provides the shortest retainer stack, which we then annotate with the size of the closure.

I have some very rough work on the [`wip/bfs-flamegraph`](https://gitlab.haskell.org/ghc/ghc-debug/-/tree/wip/bfs-flamegraph) branch