Capping Chrome's Memory Usage — Putting the TotalMemoryLimitMb Policy to Work
Even with Chrome's Memory Saver enabled, piling up tabs will happily eat several GB of memory. Memory Saver is a feature that "discards inactive tabs based on time or ML prediction" — it has no target for total usage. On a 16GB machine sharing space with other resident apps, that is not always enough.
I looked into how to set a "start discarding once the total exceeds this value" cap, and the enterprise policy TotalMemoryLimitMb turned out to be exactly that, so here are the setup steps and some operational notes.
What TotalMemoryLimitMb is
It is one of Chrome's enterprise policies. When the combined memory of all Chrome processes (the browser itself, GPU, and the renderer group) exceeds this value (in MB), Chrome starts automatically discarding background tabs.
One caveat: this is not a hard cap. Foreground tabs, tabs playing audio or video, and tabs in a web conference are exempt from discarding, so if the tabs that cannot be discarded alone exceed the threshold, it stays over. It is strictly a "discard trigger threshold."
Setting NetworkPredictionOptions to 2 as well disables page preloading, which curbs the waste of renderer processes spinning up in the background for pages you might visit.
The setup script
The write target is HKLM:\SOFTWARE\Policies\Google\Chrome. A stock Windows install does not have this key, so create it first with New-Item. Administrator privileges are required.
#Requires -RunAsAdministrator
$chromePolicyKey = 'HKLM:\SOFTWARE\Policies\Google\Chrome'
New-Item -Path $chromePolicyKey -Force | Out-Null
Set-ItemProperty -Path $chromePolicyKey -Name 'TotalMemoryLimitMb' -Value 3072 -Type DWord
Set-ItemProperty -Path $chromePolicyKey -Name 'NetworkPredictionOptions' -Value 2 -Type DWord
Get-ItemProperty -Path $chromePolicyKey |
Select-Object TotalMemoryLimitMb, NetworkPredictionOptions |
Format-ListSave the above as Set-ChromeMemoryPolicy.ps1 and run it from an administrator PowerShell.
For NetworkPredictionOptions, the value 0 means always predict, 1 means only on Wi-Fi (now equivalent to 0), and 2 means disabled.
If it stops with "is not digitally signed" when you run it, you are hitting the execution policy. If you would rather not change the permanent setting, just bypass it for this one run.
powershell -ExecutionPolicy Bypass -File .\Set-ChromeMemoryPolicy.ps1
Confirming it took effect
Fully quit Chrome (including the tray-resident process) and restart it, then type chrome://policy in the address bar. If TotalMemoryLimitMb and NetworkPredictionOptions are shown with status "OK," they are in effect.
The per-tab discard state can be watched in real time at chrome://discards.
Tuning the threshold
On a 16GB machine, I consider 3072 the sweet spot as a starting value.
- 2048 (the policy's lower bound): after subtracting the browser and GPU overhead, the room left for tabs is around 1GB. Two or three Gmail-class tabs will sit over the threshold constantly, giving an experience where a tab is discarded almost the instant you send it to the background.
- 3072: enough headroom to keep four or five heavy tabs in the active zone, with a natural behavior of discarding whatever you hoard beyond that.
- 4096: a fallback when 3072 causes reloads often enough to be annoying.
Because a discarded tab is fully reloaded when clicked, if you have a habit of backgrounding a tab while filling in a form, you will lose what you typed. Register sites you want to protect under "Always keep these sites active" on Chrome's Performance settings page.
Settings to combine, and settings to avoid
Keep Memory Saver itself on the "Maximum" mode. The policy's threshold-based discarding and the time/prediction-based discarding then work in tandem.
On the other hand, turning off hardware acceleration — often cited as a memory-saving tip — is not recommended. The compositing work that lived in GPU memory merely moves to system RAM plus the CPU, which is often counterproductive. Relaxing Site Isolation (chrome://flags) does have a large memory-reduction effect, but it weakens the defense against Spectre-class attacks, so I passed on it.
If tab hoarding still bogs things down, a last resort is to list tabs out with an extension like OneTab and actually close them. Unlike discarding, no process stub remains and the memory is fully released. That said, this is manual operation, not automatic control.
Aside: the Policy Precedence section of chrome://policy
The Policy Precedence section at the bottom of chrome://policy shows the priority order when the same policy is supplied from multiple sources (Platform machine / Cloud machine / Platform user / Cloud user) and they conflict. Writing directly under HKLM, as here, falls under the highest-priority "Platform machine."
Policies also come in two levels, "Mandatory" and "Recommended." Writing directly under HKLM\SOFTWARE\Policies\Google\Chrome makes them "Mandatory," which the user cannot change from the settings screen. Writing under a Recommended subkey applies them only as defaults, which the user can override. These are distinctions aimed at organizational management, so for binding your own PC yourself, writing directly under the key is fine.
Reverting
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Google\Chrome" -Name "TotalMemoryLimitMb" Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Google\Chrome" -Name "NetworkPredictionOptions"
Restart Chrome after removing them and the default behavior returns.