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?
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?
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.
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
Based on the comments, I think there are three choices...
Chrome eats memory with each open tab, so either close some tabs, or try another browser like Firefox.
Because of the small amount of RAM you have, try increasing your swap to 8GB. This can be done easily using gparted.
Install more RAM.
If you need more clarification on any of these, please ask.
Cheers, Al