In this post, we are going to use a brand-new (at the time of writing) and still somewhat experimental profiling method in GHC to show how to identify a memory leak and the code causing it. This new profiling method, implemented by Matthew, allows us to map heap closures to source locations. A key feature of this new profiling mode is that it does not require a profiled build (i.e. building with -prof). That’s desirable because non-profiled builds use less memory and tend to be faster, primarily by avoiding bookkeeping that prevents optimization opportunities.

A big thank you to Hasura for partnering with us and making the work presented here possible.

(read more)

Other recent blog posts