Tool for generating memory usage

Hi,
the goal is to well understand memory usage
or to optimize code.
This is the kind of result i aim:


Does exist something close ?

I don't think there exists anything for generating that kind of image, no. Note that you probably don't want string slices in your struct.

Hi Alice,
which modules and methods could help me to produce such a tool for introspection part.
for the graphical part i think to manage with little game engine such as ggez for rendering.
it's an experimental idea of project.

I have been experimenting with showing locals next to backtrace frames in pretty_backtrace. The problem with this is that the backtrace crate doesn't allow you to inspect frame registers. It did get support for getting the stack pointer recently though: https://github.com/rust-lang/backtrace-rs/pull/341. If you want to ignore locals in registers, then this combined with gimli for parsing the DWARF debuginfo may work.

Hi Bjorn, it seems a little to deep for my knowledge just now :wink:
for the moment, i do it by hand with pen and paper:
Here is my check list (no reflex yet) , please correct me if needed:
1-Type ?
2-mutable?
3-who is owner ?
4-who will borrow it ?
5-who will take ownership and will it release it ?
6-relationship with function, structs, files, sockets, threads ?
7-Asynchrone?
8- Scope, closure ?
9-who need Read access , write access ?
10-kind of memory ? Stack, Box, A/Rc, Refcell , Mutex ?
11-public ?

Any idea ?

If you just want to know how much memory is owned by an object, what about using the heapsize crate?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.