Why does the GMail web page use so much RAM?

14

5

When I log into my GMail account (using Firefox 31.0 via Ubuntu 14.04 64bit), if I save that web page to my desktop, the file size is 1.3 MB.

However, if I look at Firefox's RAM consumption before logging into GMail, and then after. GMail increases RAM consumption by well over 200MB!

Even when I run Firefox in safe mode (which disables plug-ins/extensions), I see this huge increase in RAM consumption upon logging into GMail.

Surely, behind the scenes, the GMail web application hasn't just downloaded and cached 200+ MB of data so instantly.

I thought maybe it might be buffering some local cache that it might have been using in an earlier session, but I used another web browser (that I had never logged into GMail with before), and it too used a lot more RAM after logging into GMail.

How is a 1.3MB web page taking up over 200 MB of RAM each time you log into it?

What inefficiency or caching-strategy can account for this website consuming 200 times (in RAM) the amount of data that it actually displays?

LonnieBest

Posted 2014-08-14T20:08:58.590

Reputation: 1 099

Question was closed 2014-08-27T04:11:12.363

Due to GMAIL's poor resource management, I've decided to start using a email client again (specifically MailSpring).

– LonnieBest – 2019-07-29T15:56:33.893

Answers

15

Gmail's web page is running MANY scripts in the background on timers, etc. These take up memory as they work. Your "Saved" copy won't have these scripts (at least not in a working/running manner), and their associated objects in memory.

If you use a memory profiler (built into most modern browsers' development tools) you can see what's actually using memory.

When I take a snapshot of my "idle" gmail page, there's 136,441 objects loaded in memory.

Those objects range from using 32 bytes of memory, to a few kilobytes, up to over 4 megabytes, depending on the object.

And that doesn't include the memory used by the browser to actually render the page to you.

Ƭᴇcʜιᴇ007

Posted 2014-08-14T20:08:58.590

Reputation: 103 763

13Doesn't that seem awfully bloated for a page that displays 100 rows of "From", "Subject", and "Date" with a few links and minor images? I mean, I can see pre-Loading some things for performance sake, but I cannot conceive how the page could be so poorly written that it takes 200MB of RAM to run it. At this rate, one day the GMAIL web page will use more RAM than would fit on a blank CD! – LonnieBest – 2014-08-15T17:05:59.453

2Even here in the future, this is still a big deal. I went from 200mb of ram usage down to 20mb using the HTML version. w.t.f. – YetAnotherRandomUser – 2017-09-19T13:47:10.540

This Basic HTML feature works great on a chromebook with 2G RAM that can only handle at most one gmail tab at a time. Now I can have all 3 of my gmail accounts in a tab each and still have plenty of RAM. Tip to switch between multiple gmail accounts in the Basic HTML version: http://thetechgears.com/add-switch-multiple-gmail-accounts-basic-html-view/

– user3773048 – 2017-10-18T22:09:36.660

2@LonnieBest That time has come – Talha Junaid – 2018-10-03T12:28:43.090

5 years later I now see it using around 600 MB regularly. – forgivenson – 2019-11-01T12:41:35.230