Having a 32-bit system with 4G RAM and 7G swap. Linux 3.5.0-49-generic i686.
From time to time the memory bank is filled up and everything lags down. In 99% of the cases it is Chrome using vast amounts of RAM and swap. Some times it helps to close down some windows, but often not. As an example for last time:
Mem: 4G in use
Swp: 3G in use
Chrome: 4 windows, 17 tabs.
Closing Chrome and after a while I sit with
Mem: 450M in use
Swp: 220M in use
This is a rather typical scenario. The pages are "normal" web-pages like Stack Exchange sites, some articles and perhaps a news-site or two.
One thing I notice is that it takes some time for the system to normalize after I shut Chrome down. This is long after last process has died according to htop
/ top
. It keeps lagging etc. Guess this is due to the swap.
My question is if it is advisable to use some technique to flush the swap (push it to RAM so to speak), and how. And, is there some other technique to help in this particular predicament?
Edit: As for extensions I only use
- Vimium, which usually does not consume much.
- Session Buddy, (so that I can save my tabs when I need to do a Chrome boot), but this one also use (relatively) little memory. Even so I usually have it disabled and only enables it before I do a shut down and when I want to restore some of the tabs from a previous session.
- Flashcontrol
I have also tried longer periods with no extensions, not that it helped.
When it comes to extensions/plugins the worst culprit is flash. Using Flashcontrol this helps somewhat, but all over the issue persist.
I usually check this using Chrome's own Task Manager, Shift+Esc
~/.cache
is the default i think - is that where yours is? What sort of filesystem does that reside on? There are command-line flags for controlling cache size/location in chrome such as--disk-cache-{dir,size}=...
You should try relocating that to a size-limitedtmpfs
mount. And, honestly, w/ 4gbs of RAM i cant understand why you would want a swap at all if not for hibernation. – mikeserv Jun 05 '14 at 16:54