Bug 1805996 - Apply malloc_size_of to most types to gather heap-allocated memory #2794
+384
−36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is not yet complete.
It's applied for all metric types and part of the global Glean object. However it doesn't expose any method yet to get the information about the global Glean object.
Metrics are generated in user code anyway, so measuring their memory usage needs codegen.
This also doesn't measure some other memory usage:
This is a first attempt at integrating
malloc_size_of
to use that in a memory reporter inside m-c.I have PoC code for m-c using this too.
There's some things I don't like yet and probably need to reach out to folks.
One of them being
wr_malloc_size_of
being different versions on crates.io and in-tree with differing implementations.