зеркало из https://github.com/mozilla/gecko-dev.git
0b6b4d9629
After bug 1586236, we use the memory resource notification object to detect a low memory situation on Windows, which is signaled when the available physical memory is low. If the available physical memory is low, however, it's possible that there is still commit space enough for the application to run. In such a situation, we don't want to make aggressive efforts to reduce memory usage. This patch makes sure we send the memory pressure event (both New and Ongoing) only when the available commit space is lower than the threshold value defined by the pref "browser.low_commit_space_threshold_mb". Its default value is set to 200MB based on our telemetry data indicating ~60% of OOM crashes with <100MB, ~75% with <300MB. To use the pref in `nsAvailableMemoryWatcher`, this patch moves the call to `AvailableMemoryTracker::Init()` to `XRE_mainRun()`. It was in `NS_InitXPCOM` because the old initialization code hooked APIs and needed to be done while the process has only one thread (bug 741540). The current `AvailableMemoryTracker` does not use hooks, so it doesn't have to be initialized that early. Differential Revision: https://phabricator.services.mozilla.com/D115605 |
||
---|---|---|
.. | ||
docs | ||
init | ||
parser | ||
test | ||
Preferences.cpp | ||
Preferences.h | ||
SharedPrefMap.cpp | ||
SharedPrefMap.h | ||
StaticPrefsBase.h | ||
components.conf | ||
greprefs.js | ||
moz.build | ||
nsIPrefBranch.idl | ||
nsIPrefLocalizedString.idl | ||
nsIPrefService.idl | ||
nsIRelativeFilePref.idl | ||
nsRelativeFilePref.h |