back
▲ 1 points

Ask HN: What makes a browser and its tabs take up RAM?

by thoughtpeddler·5y ago·2 comments·view on hn ↗
Why is it that a web browser like Google Chrome will itself take up 400-500MB of RAM, and each tab anywhere from 20MB - 500MB? What else is being loaded up into RAM besides page content for tabs, and extensions/plugins for the browser?

Understandably, the more a tab loads, such as a heavy page full of large ads, the larger that tab's helper process will be. Conversely, if one loads a basic HTML file with just a few paragraphs of text, that tab will be ~20MB.

But then, why does the browser process itself take up 400-500MB, and for that matter the GPU renderer another 500-800MB? What leads to this bloat?

2 comments
In an OS with virtual memory and swap, it generally makes sense for apps to allocate as much memory as they can usefully use. Unused RAM is wasted. If memory pressure increases the OS will just swap out the less recently used tabs.
I hear you, but then why do other apps keep their RAM footprints as low as possible? It's a competitive differentiator -- at least among us nerds -- for apps to claim having a "low memory footprint". What prevents apps from allocating to themselves arbitrarily large amounts of RAM?