Google Chrome will take up my memory to the point where it causes my computer to freeze to a near halt. What can I do to prevent this?

20,165

Solution 1

The short answer: In Chrome, press Shift+Esc to see what tabs are using up too much RAM, and refresh or reload those tabs from time to time to reclaim memory.

The long answer: I think this is more of a Chrome problem than a Ubuntu problem.

I recently ran into this problem using Windows 7 with a Chrome tab opened on rt.com with the comments section at the bottom of a story opened. The comments section is driven by spot.im and will consume over a gigabyte of RAM over an hour of doing nothing but sitting there. Windows 7 would issue a low RAM error and then I'd have to reboot. The same problem exists within Ubuntu + Chrome but not nearly as bad as Windows + Chrome.

Then I discovered Shift+Esc within Chrome to bring up memory display stats, where I could watch how much RAM each tab was consuming. This works on Windows and Ubuntu.

When available memory (RAM + SWAP) runs low, a program called "OOM Killer" (Out of Memory) starts up and "intelligently" kills running applications and stops new applications from running. OOM Killer was improved in Linux Kernel 4.6, but I can't say exactly how.

I did a test the other night using Chrome to burn up 95% of RAM and 65% of swap using OOM killer under Kernel 4.7.1 and the system remained stable. I couldn't do new things like Alt+Print Screen but could still reboot no problem. Chrome did error out on reboot and couldn't restore the 20 odd tabs from the previous session, but that isn't a surprise.

Solution 2

Outside of using an extension for chrome, I dont know of a whole lot that you can do to fix it. On my personal computer i use The Great Suspender (When i do use chrome)

https://chrome.google.com/webstore/detail/the-great-suspender/klbibkeccnjlkjkiokjodocebajanakg?hl=en

Solution 3

Based on the comments, I think there are three choices...

  1. Chrome eats memory with each open tab, so either close some tabs, or try another browser like Firefox.

  2. Because of the small amount of RAM you have, try increasing your swap to 8GB. This can be done easily using gparted.

  3. Install more RAM.

If you need more clarification on any of these, please ask.

Cheers, Al

Share:
20,165

Related videos on Youtube

Anon
Author by

Anon

Specialties: Keyboard Layouts Audiobooks and Text to Speech Qt

Updated on September 18, 2022

Comments

  • Anon
    Anon over 1 year

    It gets so horrible that I can not even switch to TTY1 to force a reboot. I have to hard reset, and I lose work.

    Ideally, I would like to be able to use the chrome browser on Ubuntu without having to keep reminding myself to close tabs.

    Are there any extensions for Chrome, or tools for Ubuntu that can help prevent me going past the point where Ubuntu eats up all the RAM and becomes incapacitated?

    • TheWanderer
      TheWanderer over 7 years
      How much RAM do you have?
    • Anon
      Anon over 7 years
      @Zacharee1 4 Gigabytes
    • TheWanderer
      TheWanderer over 7 years
      And how many tabs do you like to have open at once?
    • Boris Hamanov
      Boris Hamanov over 7 years
      4GB RAM. How big is your swap file? In terminal, type swapon. Let us know. Cheers, Al
    • Anon
      Anon over 7 years
      A dozen, and my swap is 4 gigs, per usual.
    • Elliptical view
      Elliptical view over 7 years
      Perhaps this is not only a chrome issue, but something else is also using memory up? You might want to open system-monitor and take a look.
    • WinEunuuchs2Unix
      WinEunuuchs2Unix over 7 years
      Has this been solved yet? Are any of the answers close to a solution?
    • Anon
      Anon over 7 years
      @WinEunuuchs2Unix I have been using chrome.google.com/webstore/detail/the-great-suspender/… in answer by T-he-game. I have not had a freeze since, but it doesn't seem like an ideal solution, due to it being a plugin, and that I am always afraid of losing work in other tabs.
    • WinEunuuchs2Unix
      WinEunuuchs2Unix over 7 years
      Did you find the name of the website that stole all the RAM? Just curious.
    • Anon
      Anon over 7 years
      @WinEunuuchs2Unix I wasn't under the impression that it was a website, but now thinking about it... I remember a few sites here and there with Flash that would continuously eat more and more ram.
    • WinEunuuchs2Unix
      WinEunuuchs2Unix over 7 years
      To find out the website see the answer posted below this comment.
    • nisevi
      nisevi almost 7 years
      You can restrict the memory usage of chrome with cgroup gist.github.com/juanje/9861623
  • Anon
    Anon over 7 years
    I will give this a try, and see if this helps out. Will comment if this helped solve my issues. Thanks.
  • user1735921
    user1735921 over 6 years
    man chrome is idiot seriously but then again, I want sync my google account and that is only possible with chrome. Perhaps there should be a lighter version of chrome without extensions. Anyways thanks for the help, Shift+Esc really helped.
  • Zimo
    Zimo over 2 years
    FireFox is worse