Is there a possibility to determine rust program memory usage?

In the end of rust-book I read told about user allocators support and that it uses some performance allocators when and where possible. I am curious, maybe rust also gathers some information about memory usage? Or in order to do this I need to implement my own allocators?

1 Like

I asked a similar question last year, and was pointed to heapsize.

Maybe it is also possible to call malloc_print_stats if the the Rust programm uses jemalloc: