How to get a heap visualization

Ben Gamari ben at well-typed.com
Wed Sep 20 17:36:37 UTC 2017


Erik de Castro Lopo <mle+hs at mega-nerd.com> writes:

> Ben Gamari wrote:
>
>> I should point out that there is a differential (D3055) by erikd from
>> earlier this year which folded ghc-heap-view into GHC. The goal was to
>> make heap-view a supported library which could be relied upon by third
>> party tools. As far as I can remember most of the hard work is done; it
>> just needed some finishing touches. Perhaps you would be interested in
>> picking it up?
>
> Sorry if I gave the wrong impression, but IMO ghc-heap-view is a *long*
> way from being ready to integrate into GHC. ghc-heap-view currently supports
> most of the normal/simple heap object types. but has no support for more
> complex objects. Furthermore, levity polymorphism adds a whole new dimension
> to the problem. My estimate of the amount of work required to make ghc-heap-view
> cover all the heap objects was such that I abandoned the project. I would
> love to see someone pick it up and run with it.
>
I'm not sure it's actually so far off. As far as I recall the big issues
were,

 * teaching it to understand profiled and debugged info tables
   (annoying, but not difficult)
 * teaching it to understand unlifted fields

As far as levity polymorphism is concerned, this shouldn't affect heap
view at all as its simply a Core-level change; the STG machine and its
associated heap layout doesn't change at all. It's easy for me to say
having never worked on the patch, but I'd be surprised if it were more
than a weekend away from completion.

I should also mention that if you just need to poke around at the heap
inside of gdb, you might consider using my GDB Python extension [1].
It's not terribly well documented, but I think it's pretty
self-explanatory and I'm happy to add some documentation is there is
demand.

Cheers,

- Ben


[1] https://github.com/bgamari/ghc-utils/blob/master/ghc-gdb.py
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/glasgow-haskell-users/attachments/20170920/a29b6e57/attachment.sig>


More information about the Glasgow-haskell-users mailing list