Web Browsers Have A Reputation As RAM Hogs, But Why?

Key Takeaways Web apps are more complex due to evolving technologies and frameworks that allow for dynamic content. Modern websites have massive codebases, comparable to operating systems, with complex media … Read more

Taylor Bell

Taylor Bell

Published on Apr 05, 2024

Web Browsers Have A Reputation As RAM Hogs, But Why?

Key Takeaways

  • Web apps are more complex due to evolving technologies and frameworks that allow for dynamic content.
  • Modern websites have massive codebases, comparable to operating systems, with complex media management backends.
  • Browsers often trade performance for stability, speed, and security through process isolation, adding memory overhead.

Web browsers have long had a reputation for being excessive RAM hogs. Any quick search will dig up hundreds of memes and forum posts about high RAM utilization in browsers even while displaying static websites.

As the web has evolved, so have our web browsers — morphing from static windows to a text-based online world into dynamic content powerhouses that drive our interactions with rich web apps such as video calling. But despite this, even the best web browsers have held onto their reputations as RAM hogs. So why do browsers need so much RAM, and should you be concerned?

Web apps are far more complex today

The technologies powering the web have evolved significantly.

A screenshot of Facebook's React Github Repo.

Source: Unsplash

Web apps have become extremely complicated for a variety of reasons. Web technologies were long held back by a lack of uniform Javascript standards support across browsers, with each browser often promoting its view on how the web should work.

Transpilers, tools that compile code from one language down to source code for another language, helped eliminate this problem by allowing developers to write code in a higher-level language or for a newer standard and convert it to something that is understood by older browsers. Two of the most popular transpilers are Basil and Typescript, both of which build backward-compatible Javascript.

Transpilers allow developers to write code in a higher-level language or for a newer standard and convert it to something that is understood by older browsers

This standardization came hand in hand with the development of large frameworks for building complex interfaces such as Vue, Angular.js and React. This also made building responsive designs for a range of screen sizes easier. These frameworks also introduced features that helped build very dynamic webpages without grinding your browser to a halt.

Modern websites have huge codebases

All of this has allowed us to build ever more complex apps for the web. Facebook.com (including backends) contains upwards of 50M lines of codelikely significantly more than the browser it runs on and over 100x more than the space shuttle’s primary flight computer.

Obviously, all of this code isn’t running at once, but it serves to illustrate that modern websites are almost comparable to operating systems in their own right — with media management, file browsers, video and picture streams, complex async backends, and much more. This has been enabled by some of the technologies above. And unsurprisingly, several of these were developed by Facebook, now Meta! If nothing else, the mere existence of ChromeOS is a testament to this.

Web browsers sacrifice performance for stability, speed and security

By separating out individual tabs, browsers add overheadScreenshot of the chrome task manager

Modern browsers constantly make a tradeoff between speed and performance. Whether you notice it or not, your browser is constantly preloading and caching content based on predictions of resources it might need in the future. While this can have an impact on your total available system resources, it can also dramatically speed up your browsing experience.

Modern browsers also make tradeoffs for memory around process isolation. We’ll look at Chromium specifically, as it’s by far the most popular browser engine. Chromium’s process model is a bit of a long readbut Chromium now creates a new process for each “web site instance,” which is essentially a specific website and its associated resources. This helps limit the impact of any hung processes, with a tradeoff of greater memory usage for each process.

This also enables site isolationwhich restricts the ability of websites to access each others’ data within the browser, and protects against a range of security threats. In the past, Chromium has used a process-per-site, process-per-tab, and single-threaded model, but has moved towards more sandboxing of sites over time, increasing memory overhead. Originally, browsers were single-threaded, and a single stuck webpage or crash could bring the entire browser to a halt.

If you’re interested in checking out how Chrome is using RAM, it has its own task manager which will show you which site instances are in use. You can see this under More Tools in the menu.

Google Chrome vs Microsoft Edge

Related

Google Chrome vs Microsoft Edge: Which browser is better?

Both Google Chrome and Microsoft Edge are feature-packed, but which one is superior?

The web is full of rich content

Media, advertising and content drive the webScreenshot of the XDA-developers youtube channel

This one is a bit simpler. As the web has become more dynamic and faster with more rich content, web pages have also gotten heavier. More and more webpages include high-resolution images, video, graphics, and ads. As we highlighted earlier, dynamic content, animations, and rich effects have also become far easier to build, and hence more prevalent.

Additionally, there is a significant amount of content running almost invisibly in your browser — everything from user interface analytics and tracking scripts, to social media hooks and more. All of this is content that needs to be loaded and handled by your browser. This is especially true of social media platforms like X, Facebook, or Reddit, where any given webpage is full of rich content.

High RAM utilization isn’t a bad thing.

Empty RAM is useless RAM

This is something that’s often confused by users talking about high browser RAM usage on their machine — it’s not always a bad thing. Your web browser is likely one of the most frequently used and most important apps on your PC, and it has become essential to modern computing. RAM is intended as high-speed temporary data storage directly associated with your CPU, one level detached from your CPU’s onboard cache.

While we need to maintain an amount of free memory for other tasks, keeping your RAM empty is doing nothing to improve the performance of your PC. Browsers using this performance and capacity to prefetch, cacheand optimize content to improve your browsing experience is very sensible. As such, browsers have rightly required more performance over time, as the web has evolved and computers have become more powerful.

Don’t worry about RAM: Web browsing is better than ever

It’s easy to see your browser’s RAM usage and assume it’s doing something wrong, but give the app some credit. Your browsing experience now is better than ever: Browsers are faster, more stable, and more secure than they’ve ever been. Your browser is almost certainly one of the most important and used apps on your desktop, and its ability to display anything from cat GIFs or online games to rich, high-definition video is an achievement to marvel at. If you’re struggling with high memory utilization on your PC and your browser is the cause, it might just be time to think about upgrading your machineor closing down some other background tasks.

Partager cet article

Inscrivez-vous à notre newsletter