Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When leaving several tabs open in Google Chrome for hours/days, I notice that some pages end up using huge amounts of RAM, to the point where the whole OS (XP) becomes unresponsive due to paging. When I'm lucky, I can finally bookmark the list of open URLs, close Chrome, and start again; When I'm not, I simply must kill Chrome and hope I can recover the list of open URLs.

  • Why is that? Memory leaks in plug-ins?
  • Is there a way to configure Chrome so that a single tab/page won't use more than a set amount of RAM?

Thank you.

share|improve this question
    
how much RAM do you have? –  Baarn Apr 17 '12 at 7:46
    
@OverTheRainbow - Why not consider Page Snooze - chrome.google.com/webstore/detail/… –  PeanutsMonkey Apr 17 '12 at 8:27
    
I have 4GB, which is enough except when some web pages end up grabbing 500MB. Thanks for the links on Page Snooze and Session Buddy. –  OverTheRainbow Apr 17 '12 at 15:51
add comment

5 Answers

up vote 2 down vote accepted

I think you should just opt for buying as much RAM as your OS can handle. You should not limit Chrome's RAM usage because it will just ruin your surfing experience on the Web. Assuming that you use your computer for surfing the Internet most of the time, you should let Chrome get all the resources it needs in order to deliver the performance that you want for you to "enjoy" running those tabs at the same time.

I don't think there is a way to limit every individual tab's RAM usage but you can limit Chrome's usage altogether. Look here:

http://stackoverflow.com/questions/192876/set-windows-process-or-user-memory-limit

I would rather not do that, if I were you, if I want smooth web surfing.

share|improve this answer
    
That's not really a solution when you don't have control over the content of the computer you're using (i.e. work computer) –  Gnoupi Apr 17 '12 at 8:43
    
in that case it would be good if there was a way to set 'priorities' to selected tabs (like the active tab gets most of the memory) since with limited RAM and with a computer you don't own the user is the one that should adapt (by reducing the number of tabs open) which is counterproductive. –  WikiWitz Apr 17 '12 at 14:58
    
Since Chrome for Windows is available as Win32 application, it only can take use (among the other Win32 applications) of the 3 GB RAM. No mather how much more your bought for the system. A Windows 7 64 Bit version doesn't help that much to fight the RAM limitation. Chrome must be compiled as Win64 Application. But than plugins most likely won't work properly anymore. –  OneWorld Jul 16 '12 at 22:18
add comment
  1. I wrote a Python 2.5 program which kills chrome's renderers when they use over a set amount of memory. I run this program under watch. (note that it uses the psutil module which isn't included with Python.)

    import sys, os, psutil
    
    if len(sys.argv) == 2:
        try:
            limit = int(sys.argv[1])
        except:
            limit = 200 # default 200MB
    else:
        limit = 200
    
    uid = os.getuid()
    for p in psutil.get_process_list():
        try:
            if (p.name == 'chrome' and any('type=renderer' in part for part in p.cmdline)
               and p.uid == uid):
                m = p.get_memory_info()
                #print p.pid,m, m.rss / 1024 / 1024, m.vms / 1024 / 1024
                if (m.rss / 1024 / 1024) > limit: # kill if rss is greater than limit
                    print 'Killed', p.pid
                    p.kill()
        except psutil.error.NoSuchProcess:
            pass
        except psutil.error.AccessDenied:
            pass
    
  2. I rely on Session Buddy to recover the open tabs when chrome fails to restore them.

share|improve this answer
    
How does Chrome handle it's renderers being killed? What behavior does the tab exhibit after its renderer is killed? Oh, I just saw your Session Buddy comment, so that means that Chrome fails to restore them sometimes, okay. Does this happen often? This is really neat, thanks! –  Human Apr 6 at 21:58
1  
@Human The tabs that used that renderer process that was killed become crashed tabs. But although the script above works nicely with Chrome 12 in later versions it also kills extensions which unlike in Chrome 12 are ran in renderer processes rather than in extension ones. –  Dan D. Apr 7 at 1:05
    
@Human It is possible to lose the last tabs if you fail to click restore. Also even if you have the Last Tabs file, it is not possible to restore tabs from that file. I attempted to determine the format and extract the URLs from it once long ago. It wasn't successful. And I have more trust in SQLite than in the binary format that Chrome uses to store the current session's tabs which is why SB is better. –  Dan D. Apr 7 at 1:06
add comment

It isn't necessarily plugin. Note that webpages are no longer static. Some webpages just have a non-trivial amount of async activity going on. Add on the activity from the plug-ins and you got some unknowns.

The best remedy I have found is to kill the webpage and reload it. AFAIK, there is no way to limit the amount of RAM a webpage uses.

share|improve this answer
add comment

Kill the tab process that's using the large quantity of memory (I notice that anything with Flash tends to use 500MB+). You can just reload the dead tabs later when you want to resume working in them.

share|improve this answer
add comment

Use TabsOutliner extension - it will give you easy way to "shut down" the tabs without actually removing them from your context and current session list. Very useful.

Tabs Outliner Extension

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.