Profiling memory usage in given process

no, not at the moment.

Yeah, so I was trying to figure out what the library I use is allocating. And I’m not super familiar with the library internals, would be just good to have a snapshot at some point and look at the terms it creates, run some function again and see what’s been allocated more etc., basically to find what causes the bloat.

I have ended up doint precisely that but on a fork of library basically printing out the terms to file with File.write! :erlang.term_to_binary(some_variable) and then analysing that to figure out which terms are being duplicated unnecessarily.

Why not use tracing for this? Seems like a perfect fit.

I tried recon_trace - but it seems to be able to trace function calls only, not giving me any insight into what happens within functions themselves?

That is true. However, since you cannot loop without calling functions I’ve very rarely found that to be a limiting factor.