How to get a heap visualization

Yitzchak Gale gale at
Sun Sep 3 16:43:00 UTC 2017

Joachim, first and foremost, thanks for the awesome libraries
ghc-vis and ghc-heap-view.

The design trade-offs for ghc-vis do make sense if you think of
it as a didactic tool. But as a debugging tool, the most important
factor is that it should "Just Work", with no big builds, no fiddling,
no googling. When you reach for a debugging tool, you are
*already* in a debugging situation; you don't have patience
for also debugging the tool.

I wrote:
>> Getting ghc-vis to compile looks hopeless, for a number of
>> reasons..The dependencies on gtk and cairo are huge.

You wrote:
> Is that really a problem?

Admittedly I haven't tried in quite a while. In the past,
getting all the Haskell libraries and C libraries to match
up and work together on any given platform at matching
versions was a huge task. If nowadays you can just type
"stack build" or "cabal install" (with new-build or in a
sandbox) on even one platform and have it just work,
reliably every time, month after month, that would be an
amazing feat.

But in my case, I need even more than that. I need it to
"Just Work" on certain specific platforms, none of which
have ever been known as the best for running GTK:
Windows, and headless Ubuntu.

>> The heap scraper backend for ghc-vis, ghc-heap-view,
>> looks usable, and better supported than vacuum.
>> But is there a quick and simple
>> visualizer for its output, without ghc-vis?

> Well, the :printHeap command that comes with it does
> “visualize” things as something resembling Haskell syntax...
> I don’t know of anything more graphical besides ghc-vis,
> but you could roll your own, if you want to; you can use
> ghc-heap-view to get a graph using buildHeapGraph
> and then visualize that as you like.

Yes, this is the approach I will probably take. I'll start with
just printing the output into a text file. Maybe I can massage
that and find what I need.


More information about the Glasgow-haskell-users mailing list