Use task_info's phys_footprint field to measure MEMORY_TOTAL on MacOS
Categories
(Core :: XPCOM, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox107 | --- | fixed |
People
(Reporter: pbone, Assigned: pbone)
References
(Depends on 1 open bug)
Details
Attachments
(3 files)
This API exists since 10.11 (Bug 1779138 Comment 12) and may be more in-line with what people expect, certaily it matches what's reported by the MacOS activity monitor. Should we use it to measure our "resident-fast" memory in about:memory and within telemetry?
See for example: https://phabricator.services.mozilla.com/D153569
Assignee | ||
Comment 1•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
I have checked, from testing and the xnu sources. I'm almost certain that phys_footprint Includes shared memory without attempting to factor it by how many things refer to it. Therefore if we add all the phys_memory stats for each firefox process will will have an over-estimate of Firefox's total memory use due to counting shared-memory regions multiple times. On the other hand we used to add up the unique memory which would lead to an under estimate.
I'm not sure there's a better way to do this without introducing performance problems like Bug 1779138, since that requires actually inspecting the regions ourselves which that can have performance problems on MacOS (but might be acceptable on other OSs). I guess, until something better comes along, phys_footprint is the best we've got.
I'm going to move forward with this and propose my changes. maybe something is better than nothing for MEMORY_TOTAL, at least we'll see trends.
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
Depends on D153569
Assignee | ||
Comment 4•2 years ago
|
||
Depends on D156308
Pushed by pbone@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/66f6ca5e2b53 Use TASK_VM_INFO on Mac to provide a new about:memory measurement r=kmag https://hg.mozilla.org/integration/autoland/rev/a9c781f95f8f Add a comment about ResidentUnique's performance on MacOS r=kmag https://hg.mozilla.org/integration/autoland/rev/83b0b0acaa0a Use phys_footprint on MacOS to provide MEMORY_TOTAL r=kmag
Comment 6•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/66f6ca5e2b53
https://hg.mozilla.org/mozilla-central/rev/a9c781f95f8f
https://hg.mozilla.org/mozilla-central/rev/83b0b0acaa0a
Description
•