How to reduce chrome's virtual memory usage?

9,410

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:

  1. ulimit. Doesn't work for me...
  2. cgroup : add browser to the process group and set limits: https://gist.github.com/juanje/9861623
  3. Chrome extensions. Yes, it is not a solution, but could be a good workaround:
Share:
9,410

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    I am running a Debian Jessie and having memory issues when using Google Chrome

    Screenshot of a htop sorted by memory usage

    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
    Admin almost 10 years
    I 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
    goldilocks almost 10 years
    I 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
    eduncan911 over 8 years
    Humm. 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
    sabujp over 5 years
    this is the answer that searchers are looking for, esp the cgroup one
  • maxkoryukov
    maxkoryukov over 5 years
    But the real solution is to buy more RAM...
  • sabujp
    sabujp over 5 years
    chrome's memory usage knows no bounds, it will literally eat up as much memory as you give it
  • Topera
    Topera over 4 years
    I agree...I upgraded my RAM from 8GB to 16GB...now Chrome is eating 1GB.... :(
  • Dan Dascalescu
    Dan Dascalescu about 4 years
    @Topera: exactly the same situation here! Chrome eats up as much RAM as is available.