Closed Bug 1567366 Opened 5 years ago Closed 5 years ago

Use MADV_FREE_REUSABLE on macos

Categories

(Core :: JavaScript: GC, enhancement, P1)

Desktop
macOS
enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: pbone, Assigned: pbone)

References

Details

(Keywords: memory-footprint, perf, Whiteboard: [MemShrink?])

Attachments

(1 file)

On MacOS we use MADV_FREE to discard pages we're not interested in. MacOS continues to keep these pages around until there's memory pressure. However it also counts them against our process's resident set size (RSS). While it's true that they are resident pages in memory that belong to our process. When RSS is used to measure Firefox is using it's inaccurate, Firefox isn't "using" this memory, the OS could reclaim it.

MacOS adds MADV_FREE_REUSABLE which has the same behavour as MADV_FREE except that it doesn't count these pages towards RSS.

On MacOS this is the same as MADV_FREE except the pages are not counted in
RSS.

Pushed by pbone@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8fec32220fa7 Use MADV_FREE_REUSABLE on MacOS r=sfink

Hi perfherders, I'm expecting a positive (good, less memory) change in resident memory size on MacOS.

Flags: needinfo?(igoldan)
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70

(In reply to Paul Bone [:pbone] from comment #3)

Hi perfherders, I'm expecting a positive (good, less memory) change in resident memory size on MacOS.

Thank you for the heads up!

Flags: needinfo?(igoldan)

== Change summary for alert #22205 (as of Wed, 31 Jul 2019 10:12:36 GMT) ==

Improvements:

19% Resident Memory macosx1014-64-shippable opt stylo tp6 722,374,519.19 -> 585,866,731.01
13% Base Content Resident Unique Memory macosx1014-64-shippable opt 28,159,488.00 -> 24,413,354.67
13% Base Content Resident Unique Memory macosx1014-64-shippable opt 28,324,437.33 -> 24,642,901.33
7% Resident Memory macosx1014-64-shippable opt 588,158,641.40 -> 546,123,886.48

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=22205

See Also: → 1760254
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: