Make it possible to distinguish profiler-specific memory usage from the rest of Firefox
Categories
(Core :: Gecko Profiler, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox90 | --- | fixed |
People
(Reporter: mozbugz, Assigned: florian)
References
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Because of the recent changes to the profiler buffers, we now allocate "chunks" to grow the buffer as needed.
These allocations are counted as part of the "malloc" counter.
On the front-end, it makes the memory graph look like it's (almost) always growing. Though it is technically correct, this could be misleading in making the user think that there may be a leak in Firefox code, when this memory increase wouldn't happen when the profiler is not running, which is what the user is presumably most interested in.
And since chunks are typically 1MB, they could hide smaller changes that the user would also be interested in.
Possible solutions:
- Profiler allocations could be re-counted as negative in the existing counter, to cancel them. (Nothing to do on the front-end.)
- When recording the memory counter in the sampler loop, subtract the current profiler buffer size. (Nothing to do on the front-end.)
- Explicitly record profiler memory allocations, either in markers, or in another counter. The front-end would then have to do the subtraction when showing the memory graph.
As a bonus, the front-end could display both graphs together (with and without profiler memory) if that's useful, and this could prepare for future improvements where the memory could be further split into different "arenas" (if technically possible).
cc:Nazim for thoughts on how to interact with the front-end.
Assignee | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
(In reply to Gerald Squelart [:gerald] (he/him) from comment #0)
- When recording the memory counter in the sampler loop, subtract the current profiler buffer size. (Nothing to do on the front-end.)
The patch I submitted uses this approach. Here's an example profile: https://share.firefox.dev/2PTm2Zp
Comment 4•4 years ago
|
||
bugherder |
Description
•