Why do web pages take so much RAM?

Solution 1:

Chrome is the heaviest consumer of RAM in the browser market. It trades increased memory usage for increased speed. If you run low on available RAM however, it becomes the slowest browser in the market (compared to one that would be small enough in resource usage to remain fully in RAM instead of paging to hard disk.)

Here the Chromium development team discusses the good and bad of this memory model used in Chrome.

And here you can configure Chrome to use alternative memory models with various tradeoffs, including "firefox style" single process mode: http://dev.chromium.org/developers/design-documents/process-models

Solution 2:

  1. Why do web pages take so much RAM?

Chrome uses a per-process model which means that for each tab (or group of related tabs), it uses a separate process instead of a separate thread. That basically means that each tab is a separate running program. That way, if any crash, they go down by themselves instead of taking down the whole browser (it does the same thing for plugs and most extensions).

This has its obvious benefits (the sandboxing being the primary one), but of course it also has disadvantages like the fact that each one has memory overhead, which means that Chrome uses more RAM overall for the same set of open pages than browsers that do not use a per-process model (other browsers have started moving toward this method since Chrome was released).

As you have noted, the per-process rule does not necessarily mean that every tab gets its own process. It depends on how the page was opened. Using open in new tab or open in new window opens the page/link in the same process as the parent, but open in incognito window opens it in a new process as do the new tab and new window commands.

Another reason that pages take up a lot of RAM is that these days, most web pages include lots of JavaScript and Flash which make them both CPU and RAM heavy (which also means that older systems cannot browse the Internet that comfortably, so there is no longer such thing as a "used, old, but good-for-browsing system"). Worse, plugins and extensions (and possibly even Chrome itself) could leak memory after a while, increasing the memory usage in time.

  1. Is there a way to know how much RAM each page takes, so that I investigate?

Unfortunately there is no (known/easy) way to see the per-page memory usage. The closest way is to press Shift+Esc or right-click the tab strip and select Task Manager to see the per-process memory usage.

One thing you can try is to open each page in a new process (using one of the aforementioned methods) and then compare.