I am currently looking into rewriting an existing rather slow Python3 email analysis application using Rust. One of things that I log in my current application is how large various memory objects are (to help the admins know if they need to increase the RAM on the Virtual Machine that runs the app), using a recursive sizeof similar to the one at https://code.activestate.com/recipes/577504/. It is an approximation of the bytes used, but it is good enough.
If I create a Vector of Structs (e.g. email sender, recipient, and subject), then look at vec.len or vec.capacity, I always get a sizes related to the type in the struct, not the actual memory being used. Is there a Rust function or crate which will help me find the total memory in use?
(EDIT: In case it is relevant, currently using Rust 1.4.0 on OS X, but live app will be rebuilt for Linux)