Memory allocated by `cert_storage` rust crate not reported to about:memory
Categories
(Core :: Security: PSM, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox90 | --- | fixed |
People
(Reporter: nika, Assigned: rmf)
References
Details
Attachments
(3 files)
When running the DMD tool to identify heap-unclassified memory in Gecko, I noticed that a significant amount of allocated memory is allocated by the cert_storage
rust crate, specifically with stacks resizing hashtables from load_crlite_stash
(https://searchfox.org/mozilla-central/rev/277ab3925eae21b419167a34624ec0ab518d0c94/security/manager/ssl/cert_storage/src/lib.rs#457).
On my local machine, this one allocation site amounted to over 8MB of heap-unclassified memory in the parent process due to this field: https://searchfox.org/mozilla-central/rev/277ab3925eae21b419167a34624ec0ab518d0c94/security/manager/ssl/cert_storage/src/lib.rs#457.
These objects should be integrated with our existing memory infrastructure so they do not appear as heap-unclassified in views such as about:memory
.
I believe this can be done using a similar strategy to what is taken by webrender and servo using the malloc_size_of
crate and some manual integration with the c++ reporting infrastructure.
Reporter | ||
Comment 1•5 years ago
|
||
Attached a more complete DMD report which is filtered to list all stack frames containing 'cert_storage'.
Comment 2•5 years ago
|
||
To fix this, we should probably use the malloc_size_of
/ malloc_size_of_derive
crates that style
and webrender
use... Happy to help getting them hooked up, though it should be easy-ish.
Comment 3•5 years ago
|
||
The severity field is not set for this bug.
:keeler, could you have a look please?
For more information, please visit auto_nag documentation.
![]() |
||
Comment 4•5 years ago
|
||
Martinho, any interest in implementing this?
![]() |
Assignee | |
Updated•5 years ago
|
Comment 7•5 years ago
|
||
Hello R. Martinho. Are you actually working on this bug? Given that there are a lot of those unreported heap unclassified entries in the DMD report it would be good to see them correctly reported.
![]() |
Assignee | |
Comment 8•5 years ago
|
||
Henrik, I haven't had time to work on this one yet. If you're asking because you want to pick it up yourself, feel free.
Comment 9•5 years ago
|
||
No I won't be able to do it on my own, but I do lots of DMD investigations so that it would be helpful.
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Hi Dana, I don't know how complicated / time invasive it is to get implemented but for tracking down heap-unclassified memory it would be a great help to have. It's reported a lot and as such makes it harder to actually find other issues. Maybe someone could have a look at this? Thanks.
![]() |
Assignee | |
Comment 11•5 years ago
|
||
Hi Henrik. I will start working on this.
Comment 12•5 years ago
|
||
Thanks a lot.
![]() |
Assignee | |
Comment 13•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 14•5 years ago
|
||
Martinho, please add Dana and mccr8 as reviewers when this is ready for review.
Updated•5 years ago
|
Comment 15•5 years ago
|
||
Hello Martinho, I wanted to ask if you had a bit of time to already check or even work on the review comments from Dana. Thanks!
![]() |
Assignee | |
Comment 16•5 years ago
|
||
Hi Henry, I was away last week but I'm working on it now.
Comment 17•4 years ago
|
||
Comment 18•4 years ago
|
||
bugherder |
Comment 19•4 years ago
|
||
R. Martinho thanks a lot for getting this landed!
Description
•