20

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?

Ben N
  • 42,308
LonnieBest
  • 1,816

1 Answers1

20

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.