why do web browsers use so much ram, while the average size of an entire webpage is 2mb?

673 views

From what I understand, one could cache 100 web pages (obviously, 2mb is average, but there are much smaller and much larger than that) in about 200mb. 1GB could cache literally 500 web pages.

How come web browsers use so much ram then?

In: 3000

25 Answers

Anonymous 0 Comments

You’re getting a lot of confidently wrong answers. Yes, the DOM and CSSOM and JS heap and V8 JIT all need space. But not nearly as much as a tab uses. The answer isn’t normal web page stuff; it’s ads.

Ads and analytics scripts require an enormous amount of resources to efficiently steal all your data. For example, a webpage may just be some text and pictures. But here’s what it’s doing in the background:

– An ad provider package is loaded on the page. The ad provider collects a fingerprint of who you are and your interests and sets up a real time auction. It puts out a call for ads and they bid on your click on real time. Potentially dozens of scripts are loaded during this time, each one recording its own analytics to track that it bid for your view and producing a record of who you are and what you clicked. The high bidder earns the right to place an ad on your page. The ad will likely be poorly built and may even be malicious; either way, they don’t care how heavy the ads are. They’ve purchased the right to display it to you.

– An analytics package will be set up to attach handlers to every element on the page. Every click, view, and scroll will be recorded and bundled into a packet of data and streamed near real-time to a data warehouse along with a fingerprint uniquely identifying you.

– Some pages will be using something like Full Story. These pages will literally record every action you take into a replayable video for the website owner to watch back and see how you interacted with their page.

And so on.

Individual web pages are quite lightweight. It’s all the bullshit on top that kills you.

You are viewing 1 out of 25 answers, click here to view all answers.