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 defaultjemalloc
's has a relatively low performance overhead compared to other tools.ByteHound
sounded amazing but could not get it to work withapollo/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.