Provide helpers to only show the still-allocated JS object allocations
Categories
(DevTools :: Framework, enhancement, P3)
Tracking
(firefox94 fixed)
Tracking | Status | |
---|---|---|
firefox94 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Whiteboard: dt-perf-stability-mvp)
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
For now, we do have DEBUG_DEVTOOLS_ALLOCATION environment variable to help debug all the Javascript object allocations that happened during a mochitest or a DAMP test.
While it help understanding what particular code is creating many JS objects,
it doesn't help tracking memory leaks as it doesn't tell you which allocations are still alive or freed. It only tells you about where objects were allocated.
We could probably use memory.takeCensus
in order to provide a view on the still-allocated objects, which would ignore all the allocations that have been freed.
Then, once we have this view, we can probably collect a metric, similar to modules metrics introduced in bug 1458194.
The view would help trying to figure out some leaks while the record would help prevent regressions.
Assignee | ||
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
This new method allows to do some kind of diff between two allocation sites records.
It will ignore/substract the allocation sites from the first record when processing the second.
As this can sometime return only allocations without stacks,
the old view, showing all the allocations is still helpful.
Also both views can't work at the same time.
So, DEVTOOLS_DEBUG_ALLOCATIONS env variable is used to enable one of the two views.
DEVTOOLS_DEBUG_ALLOCATIONS=allocations will display all the allocation log (which may display allocations which have been freed)
DEVTOOLS_DEBUG_ALLOCATIONS=leaks will display only the allocation which are still allocated at the end of the test. So it should only display leaks.
Updated•3 years ago
|
Comment 3•3 years ago
|
||
bugherder |
Description
•