I've always wondered if it's possible to use Rust' ownership chains to attribute memory usage? I.e. calculate total bytes retained by an object?
I think the plan is to support this kind of thing with per-collection allocators - https://github.com/rust-lang/wg-allocators