gecko-dev/toolkit/xre
Toshihito Kikuchi 0b6b4d9629 Bug 1711610 - Should not trigger the memory pressure event if the available commit space is not low. r=gsvelto
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
2021-05-24 21:29:46 +00:00
..
test Bug 1706501 - Make CommandLineParserWin::HandleCommandLine take nsTSubstring. r=mossop 2021-04-27 18:20:51 +00:00
AssembleCmdLine.h
AutoSQLiteLifetime.cpp
AutoSQLiteLifetime.h
Bootstrap.cpp Bug 1519636 - Reformat recent changes to the Google coding style. r=necko-reviewers,geckoview-reviewers,agi 2021-04-26 15:52:25 +00:00
Bootstrap.h Bug 1567341 - Allow geckoview.test to run xpcshell. r=esawin 2021-03-24 21:49:38 +00:00
CmdLineAndEnvUtils.cpp
CmdLineAndEnvUtils.h Bug 1706501 - Make CommandLineParserWin::HandleCommandLine take nsTSubstring. r=mossop 2021-04-27 18:20:51 +00:00
CreateAppData.cpp
DllPrefetchExperimentRegistryInfo.cpp
DllPrefetchExperimentRegistryInfo.h
EventTracer.cpp
EventTracer.h
LauncherRegistryInfo.cpp
LauncherRegistryInfo.h
MacApplicationDelegate.h
MacApplicationDelegate.mm Bug 1699792 - Split off the inner parts of nsStandaloneNativeMenu into a new class called NativeMenuMac. r=harry 2021-03-23 13:40:32 +00:00
MacAutoreleasePool.h
MacAutoreleasePool.mm
MacLaunchHelper.h
MacLaunchHelper.mm
ModuleEvaluator.cpp
ModuleEvaluator.h
ModuleVersionInfo.cpp
ModuleVersionInfo.h
MultiInstanceLock.cpp Bug 1700870 - Explicitly convert path to UTF-8. r=application-update-reviewers,bytesized 2021-03-31 16:29:04 +00:00
MultiInstanceLock.h Bug 1553982 Part 1 - Manage "multi-instance locks" that can be created by any component. r=bytesized,nalexander 2020-12-11 05:37:38 +00:00
PolicyChecks.h
ProfileReset.cpp Bug 1694462 - Remove the nsIThreadManager.newThread API (newNamedThread should be used instead), r=bas,KrisWright. 2021-03-02 22:34:51 +00:00
ProfileReset.h
SafeMode.h
UIKitDirProvider.h
UIKitDirProvider.mm
UntrustedModulesData.cpp Bug 1705278 - Remove DependentModules from UntrustedModulesProcessor.cpp. r=aklotz 2021-04-16 19:35:55 +00:00
UntrustedModulesData.h Bug 1705278 - Remove DependentModules from UntrustedModulesProcessor.cpp. r=aklotz 2021-04-16 19:35:55 +00:00
UntrustedModulesProcessor.cpp Bug 1705278 - Remove DependentModules from UntrustedModulesProcessor.cpp. r=aklotz 2021-04-16 19:35:55 +00:00
UntrustedModulesProcessor.h Bug 1705278 - Remove DependentModules from UntrustedModulesProcessor.cpp. r=aklotz 2021-04-16 19:35:55 +00:00
WinDllServices.cpp Bug 1706041 - Reset gDllServices when DllServices is destroyed. r=aklotz 2021-05-07 19:11:48 +00:00
WinDllServices.h Bug 1706041 - Reset gDllServices when DllServices is destroyed. r=aklotz 2021-05-07 19:11:48 +00:00
WinTokenUtils.cpp
WinTokenUtils.h
components.conf
glxtest.cpp Bug 1708407 [Wayland] Fix leaked renderDeviceName at glxtest.cpp, r=jhorak 2021-04-30 07:08:50 +00:00
moz.build Bug 1705726 - Create an interface to determine if the maintenance service registry entry exists r=nalexander 2021-05-11 19:32:51 +00:00
nsAndroidStartup.cpp Bug 1567341 - Allow geckoview.test to run xpcshell. r=esawin 2021-03-24 21:49:38 +00:00
nsAppRunner.cpp Bug 1711610 - Should not trigger the memory pressure event if the available commit space is not low. r=gsvelto 2021-05-24 21:29:46 +00:00
nsAppRunner.h Bug 1695453 - Rename IsWaylandDisabled to IsWaylandEnabled, r=stransky 2021-03-02 14:25:20 +00:00
nsAppStartupNotifier.cpp
nsAppStartupNotifier.h
nsCommandLineServiceMac.h
nsCommandLineServiceMac.mm
nsConsoleWriter.cpp
nsEmbedFunctions.cpp Bug 1707655 - Move the activation of supplemental fonts on macOS to a separate thread and try to get it started earlier. r=lsalzman 2021-04-30 13:50:47 +00:00
nsEmbeddingModule.cpp
nsGDKErrorHandler.cpp
nsGDKErrorHandler.h
nsIAppStartupNotifier.h
nsINativeAppSupport.idl
nsIWinAppHelper.idl
nsIXREDirProvider.idl
nsNativeAppSupportBase.cpp
nsNativeAppSupportBase.h
nsNativeAppSupportCocoa.mm Bug 1692391 - Replace the NS_OBJC_BEGIN/END_TRY_ABORT_BLOCK_NSRESULT macros with the functionally identical NS_OBJC_BEGIN/END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE). r=haik 2021-02-16 22:55:20 +00:00
nsNativeAppSupportDefault.cpp
nsNativeAppSupportUnix.cpp Bug 1694973 - Fix compile error when using --disable-printing" r=Gijs,karlt 2021-03-01 23:55:17 +00:00
nsNativeAppSupportWin.cpp
nsNativeAppSupportWin.h
nsSigHandlers.cpp Bug 1515229 - Make MozStackWalk/MozWalkTheStack frame skipping more reliable. r=gerald,nika,bobowen,jld 2021-04-16 04:06:02 +00:00
nsSigHandlers.h
nsUpdateDriver.cpp Bug 1705726 - Create an interface to determine if the maintenance service registry entry exists r=nalexander 2021-05-11 19:32:51 +00:00
nsUpdateDriver.h
nsUpdateSyncManager.cpp Bug 1697955 - Resolve the install path used for sync manager locks. r=application-update-reviewers,nalexander 2021-04-05 22:32:39 +00:00
nsUpdateSyncManager.h Bug 1695797 - In background task mode, only process updates if we're the sole instance running. r=mhowell,application-update-reviewers,dthayer,bytesized 2021-03-06 05:40:39 +00:00
nsWindowsRestart.cpp
nsWindowsWMain.cpp
nsX11ErrorHandler.cpp Bug 1682030 - Remove NPAPI plugin process from GeckoChildProcess r=jld,gsvelto 2021-04-06 19:28:20 +00:00
nsX11ErrorHandler.h
nsXREDirProvider.cpp Bug 1703179 - [Thunderbird only] don't do early master password prompt when in backgroundtasks mode. r=kaie,xpcom-reviewers,mccr8 DONTBUILD 2021-05-14 09:43:13 +00:00
nsXREDirProvider.h Bug 1682030 - Remove Windows NPAPI plugin proccess sandbox r=bobowen 2021-04-06 19:28:19 +00:00
platform.ini
updaterfileutils_osx.h Bug 1684173 - Add newline character at end of files when missing r=sylvestre,geckoview-reviewers,agi 2021-01-07 08:53:08 +00:00
updaterfileutils_osx.mm