You are not logged in.

#1 2016-07-24 11:24:11

grimscythe
Member
Registered: 2016-05-05
Posts: 24

Chrome eating so much memory.

Hi everyone!

I am concerned about the amount of memory consumed by Google Chrome on Arch linux 64 bit under Gnome 3.20. I have used said software on other linux distros and also on Win 7 and I do not recall it eating most of my 4GB ram after opening 5-7 tabs sad

Below I attached a picture showing the memory usage according to the Chrome's task manager and also I attached a picture showing top's memory usage stats (conky shows the same).

According to Chrome the usage is 738 MB. Top says 1442 MB. I mean.. I understand that on the system level additional resources are used per tab etc., BUT DOUBLE !?

Is anybody else out there with the same issue?

Imgur link

Offline

#2 2016-07-24 11:59:59

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Chrome eating so much memory.

I have 10 tabs open:

% ps -A --sort -rss -o comm,rss | grep chromium | awk '{ sum+=$2 } END { print sum/1024 }'
2180.80

So 2.18 GB.  Note that I edited this post giving a better usage of the ps/awk.

Last edited by graysky (2016-07-25 09:57:29)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2016-07-24 14:32:34

grimscythe
Member
Registered: 2016-05-05
Posts: 24

Re: Chrome eating so much memory.

graysky wrote:

I have 10 tabs open:

% ps -A --sort -rss -o comm,pmem,rss | grep chromium | awk '{ sum+=$3 } END {print sum}'
2233144

2.18 GB

That is on Chromium though right? Might try it....If Chromium works out to be more efficient than Google Chrome, then I'm laughing....
I tried about 10 tabs, got the same ~2.10GB...

Last edited by grimscythe (2016-07-24 14:36:16)

Offline

#4 2016-07-24 15:37:56

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Chrome eating so much memory.

Yes, chromium (specifically chromium-minimum from the AUR).

Last edited by graysky (2016-07-24 15:38:26)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2016-07-24 15:39:55

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: Chrome eating so much memory.

grimscythe wrote:

That is on Chromium though right? Might try it....If Chromium works out to be more efficient than Google Chrome, then I'm laughing....
I tried about 10 tabs, got the same ~2.10GB...

Of course you did, they're basically the same thing. I still have no idea why anyone would run the google-chrome package rather than the one built specifically for Arch.

Offline

#6 2016-07-24 22:28:21

grimscythe
Member
Registered: 2016-05-05
Posts: 24

Re: Chrome eating so much memory.

I guess some people are just used to certain products, like myself. What is the one especially made for Arch? Chrome minimum?
I ran some quick tests on other browsers in order of hungriness:
Google Chrome>Vivaldi>Chromium>Opera>Firefox

I do have to mention that Firefox is significantly lower on my system (~1GB with 8 tabs, somehow).

Offline

#7 2016-07-25 06:36:34

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: Chrome eating so much memory.

grimscythe wrote:

... What is the one especially made for Arch? Chrome minimum? ...

https://www.archlinux.org/packages/extr … /chromium/

chromium-minimum is an AUR package.  AUR packages aren't official.


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#8 2016-07-25 06:37:44

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,422

Re: Chrome eating so much memory.

Firefox also doesn't explicitly create seperate processes for each tab leading to, if things go haywire on one tab, that the whole browser freezes, but has the benefit of consuming less memory, and in contrast to the other browsers uses its own engine (gecko instead of blink) which might have some better effects on memory consumption in certain workloads. Google Chrome uses more memory because it is statically linked and loads libraries that would otherwise be shared + a bunch of propietary additions that would have to be manually added to chromium (new flash versions based on the pepper api, DRM enabling binaries etc.)

Last edited by V1del (2016-07-25 06:38:30)

Online

#9 2016-07-25 08:35:10

grimscythe
Member
Registered: 2016-05-05
Posts: 24

Re: Chrome eating so much memory.

V1del wrote:

Firefox also doesn't explicitly create seperate processes for each tab leading to, if things go haywire on one tab, that the whole browser freezes, but has the benefit of consuming less memory, and in contrast to the other browsers uses its own engine (gecko instead of blink) which might have some better effects on memory consumption in certain workloads. Google Chrome uses more memory because it is statically linked and loads libraries that would otherwise be shared + a bunch of propietary additions that would have to be manually added to chromium (new flash versions based on the pepper api, DRM enabling binaries etc.)

That is solid, thanks for clarifying that V1del. I think I'm going to stick to Firefox. I use Google Docs quite a bit and they are memory hungry. With 10 tabs open and one tab with a 20 page google doc open: Firefox was sitting at 1.1 GB ,where as Chrome would eat nearly 2.5 GB. I mean the difference is HUGE! Chrome is not justified with separate instances of every tab in this case I think. Chrome eats more than double the ram .... hmm

PS. Might go back to Chrome once ill buy 16 gigs of ram or more smile

Last edited by grimscythe (2016-07-25 08:59:24)

Offline

#10 2016-07-25 09:35:34

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Chrome eating so much memory.

With 18 tabs open (some of the pages are quite small):

ps -A --sort -rss -o comm,pmem,rss | grep chromium | awk '{ sum+=$3 } END {print sum}'
1388488

On the other hand you can't avoid using lots of ram if you use browse huge pages. You said it yourself:

grimscythe wrote:

I use Google Docs quite a bit and they are memory hungry.

Personally I prefer chromium over firefox, it feels more snappy and as V1del said there is a separate process for each tab in chrome/chromium, so if anything goes wrong it will not bring the whole browser down, which you should appreciate if you make use of javascript heavy pages, read google docs.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#11 2016-07-25 09:59:26

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Chrome eating so much memory.

Slightly off topic but I edited my reply above to give a better ps/awk invocation.  Results are now in megabytes directly.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#12 2016-07-25 12:46:48

grimscythe
Member
Registered: 2016-05-05
Posts: 24

Re: Chrome eating so much memory.

I do agree that Chromium/Chrome or even Opera or Vivaldi feel more snappy, but for the time being I cannot justify double the memory usage over Firefox. I just hate the moment when SWAP gets used and everything just lags like hell.

Off topic:
graysky, Love your code to check the memory usage. Made a script out of it, if aynone wants it follow this:
make a file called appusage.sh   (don't really need the .sh anyway)

#!/bin/bash
ps -A --sort -rss -o comm,rss | grep $1 | awk '{ sum+=$2 } END { print sum/1024 }'

then run, to make the file executable:

chmod +x appusage.sh

and place the script in your /usr/bin or ~/bin folder (if you have one), so that you can run the script from enywhere like so:

 appusage.sh chromium

Offline

#13 2016-07-28 05:15:28

nbd
Member
Registered: 2014-08-04
Posts: 389

Re: Chrome eating so much memory.

[al@kw ~]$ ps -e --sort -rss -o command,rss
COMMAND                       RSS
midori                      83156
dillo                        9804

bing different

Offline

#14 2016-07-28 10:10:26

grimscythe
Member
Registered: 2016-05-05
Posts: 24

Re: Chrome eating so much memory.

nbd wrote:
[al@kw ~]$ ps -e --sort -rss -o command,rss
COMMAND                       RSS
midori                      83156
dillo                        9804

That is 83MB after launch I presume?

Offline

#15 2016-07-28 10:42:35

nbd
Member
Registered: 2014-08-04
Posts: 389

Re: Chrome eating so much memory.

Yep. With three tabs opened:

[al@kw ~]$ ps -e --sort -rss -o command,rss
COMMAND                       RSS
midori                      170672
dillo                        21483

bing different

Offline

#16 2016-07-28 10:55:26

grimscythe
Member
Registered: 2016-05-05
Posts: 24

Re: Chrome eating so much memory.

nbd wrote:

Yep. With three tabs opened:

[al@kw ~]$ ps -e --sort -rss -o command,rss
COMMAND                       RSS
midori                      170672
dillo                        21483

OH wow ok....that is impressive. I might give it a go as I'm getting frustrated with firefox at this stage. It runs low on memory, but it is sluggish in comparison to any other browser I have ever used. R00KIE did mention that it might be the case.

Offline

#17 2016-07-28 11:26:08

nbd
Member
Registered: 2014-08-04
Posts: 389

Re: Chrome eating so much memory.

I actually keep using Firefox and discovered Dillo and Midori only very recently, when was searhing for a lightweight browser for Raspberry. (Dillo is rather a proof of concept, though.) However, on a normal machine I haven't noticed slugishness of Firefox even with 70-80 tabs opened, except only when some buggy script on some page eats a lot of CPU and slows down the whole browser. But this happens rarely.

EDIT: There is a thread on this forum about lagging of recent versions of Firefox, and I just make it precise that I'm using 45-ESR version.

Last edited by nbd (2016-07-28 12:27:12)


bing different

Offline

#18 2016-07-28 16:55:42

grimscythe
Member
Registered: 2016-05-05
Posts: 24

Re: Chrome eating so much memory.

I wasn't aware of the Firefox issues with the recent versions. I'll look into it as that might be the cause of my problems.I was wondering what was going on with it.....

Offline

#19 2016-07-28 17:11:10

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Chrome eating so much memory.

nbd wrote:

I actually keep using Firefox and discovered Dillo and Midori only very recently, when was searhing for a lightweight browser for Raspberry.

Another really cool browser is Netsurf. More capable than Dillo, lighter than Midori.

nbd wrote:

There is a thread on this forum about lagging of recent versions of Firefox

If you mean the "Firefox lag recently" thread, that one isn't about lag actually, and neither is it about Firefox smile, it's about a bug in the Intel driver - framebuffer compression causes the screen to not update.

Offline

#20 2016-07-28 18:28:54

nbd
Member
Registered: 2014-08-04
Posts: 389

Re: Chrome eating so much memory.

Gusar wrote:

If you mean the "Firefox lag recently" thread

Yes, I was mentioning this thread, but didn't know that it's not about Firefox; as I mentioned I don't notice any lagging in Firefox. I was just amazed with those memory usage figures posted above. 2 Gb memory for rendering 20 HTML pages reminds me jokes, when Windows XP was just released, that in 10 years for launching notepad it would be required 4 GB memory. If browsers grab unneeded memory just because computer has plenty of it, then maybe one may use cgroups for limiting its usage.


bing different

Offline

#21 2016-07-28 19:00:05

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Chrome eating so much memory.

Browsers, at least Firefox, do grab more memory if it's available, for caching. I definitely see more ram usage since I've switched from 4GB to 8GB of ram. I have less experience with Chrome/Chromium, but it's a fact that it'll by default use more memory than Firefox due to its multi-process design - every tab is its own process. This is more robust, but also more resource intensive.

Then there's also the fact that websites are getting more and more fat by the day, we're now at 2MB and more of javascript bloat on even seemingly simple websites, so blaming browsers for excessive ram usage is a bit misplaced.

Offline

#22 2016-07-28 19:54:28

grimscythe
Member
Registered: 2016-05-05
Posts: 24

Re: Chrome eating so much memory.

On the side note I thought that Firefox sluggishness could be resolved so I did some research on Arch Wiki Firefox Tweaks , haven't gone through it all yet though. First, it worked out that openGL was not switched on in Firefox. However, after switching it on the situation was even worse. Nothing has a problem with openGL on my system, but Firefox seems to have...will keep on looking to further improve the rendering issues that Firefox has.

Last edited by grimscythe (2016-07-28 19:55:09)

Offline

#23 2016-07-28 23:42:37

nbd
Member
Registered: 2014-08-04
Posts: 389

Re: Chrome eating so much memory.

Gusar wrote:

Browsers, at least Firefox, do grab more memory if it's available, for caching...
Then there's also the fact that websites are getting more and more fat by the day, we're now at 2MB and more of javascript bloat on even seemingly simple websites, so blaming browsers for excessive ram usage is a bit misplaced.

It just occured to me, that maybe my using pattern of browsers is not the one that is intended by browser's developers. One can suppose that such "proactive" memory usage policy indicates that browsers are not designed to be kept constantly running with lot of tabs opened in parallel with other applications such as Office or Eclipse running. They start and close fast, so if one limits their usage by short sessions after which they are closed, then their memory consummation already less an issue.


bing different

Offline

#24 2016-07-29 01:41:12

TheChickenMan
Member
From: United States
Registered: 2015-07-25
Posts: 354

Re: Chrome eating so much memory.

nbd wrote:

It just occured to me, that maybe my using pattern of browsers is not the one that is intended by browser's developers. One can suppose that such "proactive" memory usage policy indicates that browsers are not designed to be kept constantly running with lot of tabs opened in parallel with other applications such as Office or Eclipse running. They start and close fast, so if one limits their usage by short sessions after which they are closed, then their memory consummation already less an issue.

The internet itself is also part of the problem. For some years now some badly designed websites have continued to push the envelope of being flashy for its own sake. Most of these are also relying more on client-side technologies rather than doing the hard work on the server. People still say they don't need a great computer because they don't play games. "All I do is surf the internet." The internet takes more resources now than does running many new games.


If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet.
Niels Bohr

Offline

#25 2016-07-29 04:08:29

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Chrome eating so much memory.

nbd wrote:

They start and close fast, so if one limits their usage by short sessions after which they are closed, then their memory consummation already less an issue.

I have to disagree, Firefox takes AGES to open for me. Probably one of my dozens of plugins, which I haven't had the time to root out (I just start it on boot so I don't have to deal with the lag when actually calling it up).

Chromium does start really fast (don't really use many extensions beyond vimium) but that RAM usage doesn't work for me when I'm also running a VM in the background, so firefox it has to be at this point.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

Board footer

Powered by FluxBB