Closed Bug 1682947 Opened 4 years ago Closed 4 years ago

Use MADV_FREE_REUSE before using decommitted memory again on OSX, as per https://stackoverflow.com/questions/7718964/how-can-i-force-macos-to-release-madv-freed-pages

Categories

(Core :: JavaScript: GC, defect, P3)

defect

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: sfink, Assigned: sfink)

References

Details

Attachments

(2 files)

In reading through various things, I noticed that apparently on OSX it is intended that if you use MADV_FREE_REUSABLE to decommit memory and report that decommit to the OS's statistics, that you are then expected to do MADV_FREE_REUSE before using the memory again.

I don't know what happens in practice if you don't.

Severity: -- → S4

https://treeherder.mozilla.org/perfherder/compare?originalProject=mozilla-central&newProject=try&newRevision=112813154ad2616aeeba91824bdd1adcbaa2eee2&framework=4&selectedTimeRange=172800

This made no difference to anything but RSS measures. Looking at eg "Resident Fresh start opt tp6", it increases RSS by around 30%.

The hypothesis is that without MADV_FREE_REUSE, some amount of memory is in use but not counted in the RSS. So this new measure should be better. But it would be nice to have a way to cross-check against some other measurement. I think I need someone more familiar with OSX memory management. I'll try glandium.

Flags: needinfo?(mh+mozilla)

(Switched to review request)

Flags: needinfo?(mh+mozilla)
Attachment #9193591 - Attachment description: Bug 1682947 - Use MADV_FREE_REUSE before using decommitted memory again on OSX, as per https://stackoverflow.com/questions/7718964/how-can-i-force-macos-to-release-madv-freed-pages → Bug 1682947 - Use MADV_FREE_REUSE before using decommitted memory again on OSX, as per https://bugs.chromium.org/p/chromium/issues/detail?id=823915
Pushed by sfink@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fe8bfd66cd81
Handle madvise returning EAGAIN. r=glandium
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch

Performance sheriffs: I'm going to land the MADV_FREE_REUSE patch. I expect this to regress RSS size measures on OSX, possibly by quite a large amount. I still want to keep the patch, because the new measures will be more accurate.

Pushed by sfink@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ed96e8c21b5a
Use MADV_FREE_REUSE before using decommitted memory again on OSX, as per https://bugs.chromium.org/p/chromium/issues/detail?id=823915 r=glandium
Regressions: 1685539
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: