How to reduce chrome's virtual memory usage?
Solution 1
If you add up MEM%
for all the identical looking chrome processes, then you have well over 100%, which is impossible. That's because those are not, in fact, separate processes, they're threads, which share the same memory space. htop
shows these by default, but see here for how to change that and get a view that will make more sense to you.
Your total used RAM is 1047 of 1727 MB, so you do not have memory problems. When looking at memory stats, keep in mind that virtual memory, more properly: virtual address space, shown here as VIRT
is not real memory. It's address space, and most of the addresses aren't used and don't correspond to anything. On linux, the size of this pretend space can be up to 4 GB per process, even if you don't have that much available to start with.
A decent metric of the amount of RAM actually consumed is the RSS or resident memory size (in htop
's case, RES
). If you eliminate threads from the view, you'll see there's actually only one 142 MB google-chrome
process (actually there may be a handful of genuinely separate chrome processes, but not dozens). Another significant stat if you are trying to diagnose system performance problems is the amount of CPU time consumed (TIME+
), but again nothing looks particularly out of line here WRT chrome.
Solution 2
I use Chromium, and I'm facing the same issue: Chromium takes a lot of memory, freezing system. The problem is not in memory consumption but in my user-experience: I really don't like when my laptop turns into the brick.
There is an open issue for chromium, and today it is still unresolved: https://bugs.chromium.org/p/chromium/issues/detail?id=393395
my solutions
I am on Linux Mint, so I test several solutions:
-
ulimit
. Doesn't work for me... -
cgroup
: add browser to the process group and set limits: https://gist.github.com/juanje/9861623 -
Chrome extensions. Yes, it is not a solution, but could be a good workaround:
- the-great-suspender - a lot of reviews, under testing right now
- tab-suspender - good, but The great suspender is better (IMO)
Related videos on Youtube
Admin
Updated on September 18, 2022Comments
-
Admin over 1 year
I am running a Debian Jessie and having memory issues when using Google Chrome
I tried disabling extensions, disabling cache, flushing the cache, and disabling the web 3d rendering, but nothing really improves.
I am getting huge lags some times and I am really wondering where this is coming from.
-
Admin almost 10 yearsI did know that those were threads but thanks for the tips on how to display it more accordingly. Are you saying that google-chrome is using a decent amount of memory and the issue might come from somewhere else ?
-
goldilocks almost 10 yearsI don't see anything there that implicates chrome, no. What exactly is the issue? Is it just generally slower than you'd like, or is it actually freezing up regularly?
-
eduncan911 over 8 yearsHumm. I have Flash (really all plugins) disabled in my Chrome, requiring u to click-to-activate. I only have 2 tabs open, have pkill'd Chrome and restarted... And yet I see Chrome is using 87.2 G of VIRT memory space/address. Yes, that's "G" not "M". If that's just memory addresses, that's a lot of memory addresses... And, it persists between restarts. The two tabs are: wikipedia.org and fedora wiki pages. That's it. I only have 2 or 3 extensions enabled. Nothing crazy. I do have like 5000 bookmarks though.
-
sabujp over 5 yearsthis is the answer that searchers are looking for, esp the cgroup one
-
maxkoryukov over 5 yearsBut the real solution is to buy more RAM...
-
sabujp over 5 yearschrome's memory usage knows no bounds, it will literally eat up as much memory as you give it
-
Topera over 4 yearsI agree...I upgraded my RAM from 8GB to 16GB...now Chrome is eating 1GB.... :(
-
Dan Dascalescu about 4 years@Topera: exactly the same situation here! Chrome eats up as much RAM as is available.