3

On my Mac, OS X lags substantially when browsing through Chrome. I've researched things and understand that inactive memory is part of the free memory, that can and should be freed at a moment's notice:

Even opening a new tab, scrolling through Facebook or Gmail makes things slower. I own a Macbook Pro 13" early 2011, 8GB RAM, OS X Mountain Lion.

Can I affect Chrome's use of RAM in any way?

Edit: Thanks @bmike, Great edit! I just want to make clear that I have also fiddled around with plugins and extensions in chrome settings, even chrome://flags. Flash instance is indeed a big problem, so I have flash blocker and chrome's inbuilt flash blocker.

I was wondering whether this has anything to do with having non-mac memory in my MBP?

6
  • It's a bit unclear what you are asking here. Are you looking for ways to reduce the RAM footprint for Chrome, do you want to understand how inactive memory works or is it something else you are looking for?
    – nohillside
    Commented Jul 8, 2013 at 6:33
  • After plenty of searching, I realized that Apple does intend the way Inactive RAM should be handled. And many users suffer from this problem. So I guess there is no solution to this. My question is whether there is anyway to not allow chrome to waste RAM, as at times with just 10 tabs open the inactive RAM shoots up to 3gb and everything becomes sluggish. Thanks.
    – adifire
    Commented Jul 8, 2013 at 14:59
  • This site allows people to change/edit their question, so can you please do that to rephrase it according to your comment and then click on "reopen"?
    – nohillside
    Commented Jul 8, 2013 at 15:04
  • Amazing edit by @bmike, brought the Q into very good shape, kudos for that! Worth noting: a single SWF instance, a rogue script or extension can drain the whole memory and worse.
    – brasofilo
    Commented Jul 8, 2013 at 23:09
  • @brasofilo I agree there is a lot of room to dig into Chrome. I'm not the best person as I'm more comfortable with the unix/vm side of things and how to profile an app. I think we can all agree, it's not the browser, but what sites are loading content from within the browser that matters here. I believe Chrome has great profiling tools, but I can merely google it so I'll hope someone else with practical experience there can step up.
    – bmike
    Commented Jul 8, 2013 at 23:51

3 Answers 3

2

Here are samples of data from my 13 inch MacBook Pro with 8 GB of RAM before and after opening Chrome:

Mac:~ bmike$ vm_stat
Mach Virtual Memory Statistics: (page size of 4096 bytes)
Pages free:                         212512.
Pages active:                       931907.
Pages inactive:                     381136.
Pages speculative:                   55403.
Pages wired down:                   515533.
"Translation faults":            521414918.
Pages copy-on-write:               9952178.
Pages zero filled:               465150147.
Pages reactivated:                   93725.
Pageins:                           1567093.
Pageouts:                             6081.
Object cache: 100 hits of 17386036 lookups (0% hit rate)
Mac:~ bmike$ open -a "Google Chrome"
Mac:~ bmike$ vm_stat
Mach Virtual Memory Statistics: (page size of 4096 bytes)
Pages free:                         136402.
Pages active:                       990000.
Pages inactive:                     392735.
Pages speculative:                   53707.
Pages wired down:                   523945.
"Translation faults":            521638787.
Pages copy-on-write:               9972877.
Pages zero filled:               465252021.
Pages reactivated:                   93725.
Pageins:                           1577678.
Pageouts:                             6081.
Object cache: 100 hits of 17386267 lookups (0% hit rate)

The setup of the test is a system that's been running for 6 days, and is otherwise not misbehaving. Here are the commands I run to make sure the system is in balance:

Mac:~ bmike$ iostat 5
          disk0       cpu     load average
    KB/t tps  MB/s  us sy id   1m   5m   15m
   28.30   9  0.26   2  1 97  0.78 0.61 0.61
    0.00   0  0.00   0  1 99  0.72 0.60 0.60
   32.00   0  0.01   1  1 99  0.66 0.59 0.60
    0.00   0  0.00   0  1 99  0.61 0.58 0.59
^C
Mac:~ bmike$ vm_stat 5
Mach Virtual Memory Statistics: (page size of 4096 bytes, cache hits 0%)
  free active   spec inactive   wire   faults     copy    0fill reactive  pageins  pageout
210871 940704  53319   379363 512550  522503K  9987967  469254K    93725  1579260     6081 
210776 931311  53771   379369 521225     5150       10    32953        0        0        0 
211289 930966  53798   379369 521207     4606        0    57255        0        0        0 
211321 930971  53799   379369 521207     4589        3    45933        0        0        0 
211531 930998  53799   379369 520925    10999        0    77822        0        0        0 

I set Google chrome up to have 10 blank tabs and quit it and then ran the test above to measure exactly how much RAM changes before and after launching it. As you can see, launching Chrome took about 76k free memory pages out for the free pool and caused the inactive pool to grow by about 11.5k pages.

Given these numbers, Chrome seems highly unlikely to be causing a leak itself and your web pages might be causing the load. If you can run these tools in terminal, you'll likely see that your system had other issues with memory management and Chrome is likely the straw that puts the final load on the system before it starts swapping. Look for paging activity before you launch Chrome and also have a look at my answer here on why inactive memory is almost never the actual problem and this post hopefully explains how to convince yourself whether you have an actual problem with the memory manager or a specific program.

2
  • Yes, I'm pretty sure it is not Chrome's fault. But well I usually tend to have 20+ tabs, sometimes 100. So the sluggishness puts me off a lot. I've edited the question, love to know what you would think about that.
    – adifire
    Commented Jul 9, 2013 at 13:27
  • If the memory was a problem, you'd have crashes and instability as opposed to slowness. It might be interesting to look at your numbers for vm_stat/iostat since they will show you the health of the system. You might just have too many tabs for your CPU if you can't shut down all other apps to dedicate all resources to dozens of tabs that presumably have some flash content in many of the tabs.
    – bmike
    Commented Jul 10, 2013 at 11:04
0

I can not speak for Apple and they design philosophy. But I love they hardware and the OS.

One way to improve Chrome respond time and memory usage is to customize it in Preferences.

One know RAM eater is all the garbage flash on the web sites.

You can customize it to the point that it will not Automatically play all Flash, but ask you if you want it to play.

Go to Chrome

preferences > advanced

Privacy > Content settings

Scroll down and find the

Plug-Ins

Set it to

Click to Play

DONE :)

If you care to control even more click on the

Disable the Individual Plug-Ins

and manage individual plug-ins to your desire.

1
  • I have done all that, plus minimized all memory hogging plugins. I love Macs, the best hardware-software combination one can ever find. But I haven't really experienced such sluggishness while browsing on multiple tabs when in other Operating systems like linux or even Windows, when in machines other than Apple's I mean. So I am kind of flabbergasted to see my 8gb RAM still not powerful enough for Mac! Does that have to do with non-mac memory?
    – adifire
    Commented Jul 9, 2013 at 13:15
0

it depends on how many and whic chrome extensions you have installed and turned on. chrome running 0 extensions runs entirely different with RAM usage compared to chrome running with 20 extensions

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .