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

802 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

There are two things going on here:

1. Html, JavaScript, and timately even images are a “compressed” way to represent what you end up seeing on screen. They are representative Information that describes a much more complicated thing.

2. In comp-sci one of the major tradeoffs is whether to speed things up y utilizing more memory. Imagine if every time you had to display something on screen you had to do a really complicated math problem – you’d constantly be wasting CPU cycles recalculating something over and over. You quickly would realize that you’re just doing the same math problem over and over and can just save the result to reuse – and so you’ve used more memory to free up CPU. This tradeoff happens everywhere in software especially when performance/speed matter.

Calculate once, sauce to memory, use saved info instead of recalculating constantly.

This is the most common way memory usage grows with software.

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