Rust Heap Profiling with Jemalloc

I recently had to investigate a memory leak in apollo/router, a federated GraphQL gateway written in Rust. The first question I had was how to get a memory profile out of our running instances. For several reasons I decided to use Jemalloc's Heap Profiling tooling to do so:

  • apollo/router uses jemalloc on linux by default
  • jemalloc's has a relatively low performance overhead compared to other tools.
  • ByteHound sounded amazing but could not get it to work with apollo/router, something about it using V8 under the hood.

Took me a bit to get all the pieces working, so hopefully this post saves someone some time.

Read more  ↩︎

New Blog

In the past I've written in a couple places:

But medium is not great, and production ready graphql implied everything was about GraphQL, and I want to write about more stuff.

So here we go, this blog is powered by Zola and I'm using the terminimal theme.