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

643 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

1. The code the page runs will request additional resources that can fill up your RAM. An application can be delivered in 5 kb, but end up loading 100 mb in external resources.
2. Webpages are received in HTML: that means nothing to a computer, it needs to be parsed & processed into something that makes sense. Chrome, and other browsers, will keep a lot of this cached.
3. “One-use” resources are not explicitly one use: a “one-use” piece of code or resource will be cached to RAM and run again if you hit “reload page”. This pattern exists because, should you navigate to another page on the same site, you might encounter the same code. You can speed up page delivery by just using the old results.
4. Rendering [drawing]: turning the browsers code into an image takes a significant amount of RAM. Because of the way HTML is designed and used, it’s actually extremely difficult to determine “what exactly needs to be drawn at minimum”. So, all webpages are completely drawn and you just have a window/perspective on that image.

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