Bug 805855 adds code to free dirty pages kept by jemalloc when the nsMemoryReporterManager::MinimizeMemoryUsage code runs (AFAICT this happens when the app goes into the background, or if somebody triggers it manually from about:memory). We should consider enabling this behaviour for Fennec as well. Although... it looks like in Fennec we don't trigger the same codepath when we go into the background. In Fennec, we run the code at  but based on MXR'ing around it looks like other platforms trigger ? Need to verify that. This bug is specifically only for turning on the memory.free_dirty_pages pref in Fennec; I'll file a separate bug for the backgrounding behaviour if needed, since that will probably impact other things too.  https://hg.mozilla.org/mozilla-central/file/4a2be997f539/widget/android/nsAppShell.cpp#l440  https://hg.mozilla.org/mozilla-central/file/4a2be997f539/dom/ipc/ProcessPriorityManager.cpp#l264
Please keep an eye on bug 805855 -- I don't think we want to do this only when doing MinimizeMemoryUsage.
Created attachment 684506 [details] [diff] [review] Turn on memory.free_dirty_pages in fennec This works as expected (i.e. releases heap-dirty memory back to the system on a memory-pressure event). I tested it on Fennec by running "adb shell am broadcast -a org.mozilla.gecko.FORCE_MEMORY_PRESSURE" after startup to simulate a memory-pressure situation, and comparing the about:memory dumps before and after. The heap-dirty went down from 3.8 MiB to 523 KiB and resident memory went down from 129 MiB to 124 MiB.
Attachment #684506 - Flags: review?(justin.lebar+bug)
Attachment #684506 - Flags: review?(justin.lebar+bug) → review+
Assignee: nobody → bugmail.mozilla
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
You need to log in before you can comment on or make changes to this bug.