One of the biggest problem of Google Chrome / Chromium is using lots
of unnecessary memory. I'm not talking about closing tab processes -
this indeed releases all the memory. What is dealt with here is if the
tab is not closed and the same tab is being used for opening lots of
sites through links (but you don't want to close it yet, and you need
to keep the tab history to go to other links), the memory usage will
bloat abnormally and unnecessarily. It seems that memory used in the
same tab process can only increase on average but never decrease. My
suggestion is to dump the tab process and create a new one for any
links opening in the same tab, while preserving the back/forward
history of the tab.

The can be demonstrated by going to any website, say Google Chrome
Help. Note the memory usage in Task Manager. Go into several links,
click some 'back' (and 'forward'), then click another link. The memory
usage only increases in general but not decrease (much) even if you
navigate to a simpler site. Open a new tab and go the same final URL.
Both tabs should use almost the same memory since they are only
displaying the same page. However, in reality, I can have the former
tab (which contains some 'back' history) using 193 MB and the latter
tab (same page without history) using 31 MB. The former tab process
should need only about 31 MB to display the page, and not using memory
on any contents of previous pages. This means as much as 162 MB or 5
times the memory is wasted unnecessarily for a single tab.

I have lots of extensions so the memory usage is exaggerated (but if
the extension is hogging memory it should be add to its process, not
the tab's). So I tried to use a new profile without extensions nor
command line switches and still see the same problem. For example,
CNN.com - Privacy Statement uses 7 MB in a clean tab but 21 MB if you
go to CNN.com, click around, back, before finally going to its Privacy
Statement. Still, it wastes 2 times the memory it should need.

I have screenshot of both to prove though you may test it yourself or
already knew it. The easiest test is go search in Google, note the
memory usage, click a result and navigate back. The memory used will
already be significantly more than the original level.

This is a big problem for users on SSD and have page file (virtual
memory) disabled to minimize wear. With the limited amount of RAM,
Chrome just frequently uses it all up, the low memory message
constantly appears and Chrome eventually being forced to close. The
problem is entirely solvable if Chrome uses just what it needs - going
back and forth to any page in a tab should use the same memory as
opening the pages in a new tab.

The current workaround is to force Chrome to establish a new process
for the link you want to click, say closing and reopening the closed
tab, and periodically end bloating processes and reload all the
crashed pages, or restart the whole browser, which contradicts the
purpose of the multi-process design. Merely reload even increases the
memory, which is also abnormal too. The Purge Memory button doesn't
help much (but why in the first place do we need to purge memory? Can
it be automatic and can we have the option to force Chrome always use
the least memory?).

A quick working solution, taking advantage of the multi-process model,
can be as the Chrome comics says (http://3.ly/WrfM) to recycle the
process for different domains and further extend to any links opened
in the same tab as there is no script relationship between the current
and previous page even if they are in the same domain. For tabs opened
in the same process, memory should be more completely reclaimed when
the tab is closed (now it is not). Only then, Google Chrome will truly
have less memory bloat over time.

I am unsure if the unnecessary memory retention is for caching
previous pages, but at least there should be an option for users with
tight memory to specify Chrome not to cache in the memory, or an
option to use only the necessary memory (including virtual memory)
i.e. the memory used by tabs is always as low as after the browser is
restarted and tabs restored, or an option to enable the solution above
(is there a switch for that already?).

These are the command line switches I normally use. Notice I have
disabled the disk cache to protect the SSD:
chrome.exe --bookmark-menu --enable-udd-profiles --disk-cache-size=1 --
media-cache-size=1 --restore-last-session --experimental-spellchecker-
features --purge-memory-button --enable-gview --disable-custom-
jumplist --enable-fastback

Google Chrome version: All Google Chrome stable, beta, dev till
4.0.288.1 and Chromium
Operating System: Windows 7
URLs (if applicable): any
Error Message: Low memory

If you already know this problem please make it known here. Hope this
will spur further discussions to make Chrome better.
-- 
Chromium Discussion mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-discuss

Reply via email to