Max memory usage of a chrome process (tab) & how do I increase it?

86,346

Solution 1

By default v8 has a memory limit of 512MB on 32-bit systems, and 1.4GB on 64-bit systems. The limit can be raised by setting --max_old_space_size to a maximum of 1024 (1 GB) on 32-bit and 4096 (4GB) on 64-bit. You should be able to set this parameter when launching Chrome from a shell in Linux, or as an argument to the shortcut path in Windows.

Solution 2

Aggregated answer based on Mihai Tomescu's answer and other resources:

  1. Maximum memory per tab seems to be about 1.8GB when running a x64 Windows OS, according to this answer

  2. Increasing tab memory works fine by changing Chrome link address from "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" to "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --max_old_space_size=4096

The difference can be quickly tested using this huge image which will crash Chrome using default memory settings (Google Chrome ran out of memory while trying to display this webpage), but will render fine after increasing the memory limit.

Solution 3

I don't believe electron has a hard limit of 4gb. That may be its default, but I've been able to get to 16gb by doing the following in main.js:

  const { app } = require('electron');
  app.commandLine.appendSwitch('js-flags', '--max-old-space-size=16384');

Unfortunately no such switch exists for the Chrome browser.

Reference:

Share:
86,346
mitchellt
Author by

mitchellt

Updated on July 09, 2022

Comments

  • mitchellt
    mitchellt almost 2 years

    I am running several thousand https clients through chrome on one tab, I seem to be hitting a limit in the browser, when I check task manager the chrome process for that tab is using a whopping 897MB so I am assuming there is some sort of limit (900MB~).

    Are there any chrome wizards around that could explain this? Also it would be ideal if I could increase the max limit so I am able to run more clients through a single tab.