Most of us these days have loads of RAM to spare on our laptops and desktops. But do you remember a time when you had a computer just to do some web browsing and just 2GB of ram was what you needed?
These days you have just a few tabs open on your browser and you can see the ram just going up and up.
A good example on this is reddit. Reddit was a lightweight website (client side) but these days if you have a thread open and looking at the contents of your RAM you can see that the page alone claims around 236MB of data. The majority of it is objects that the various JS scripts on the webpage created long after the page was actually downloaded.
I normally never have more than 15 chrome tabs open and this is what that looks.
I’m not trying to make excuses for browsers, they ought to release resources a bit quicker or at least provide a slider that allows the user to make that call (because web browsers aren’t exactly sure if you’ll hit the back button or not, so it holds on to those resources for a good deal of time because reloading those resources could be a significant performance hit) and then sometimes folks get into the apologist stance and say, “well unused RAM is bad RAM.” But the bigger point folks should focus on is how absolutely insanely ginormous webpages have become, and the abusive JS frameworks that are massive and create 1000s of objects just to do a simple task is single handedly the biggest reason your web browser is eating RAM faster than Charlie Sheen can snort cocaine.
Do me a big favor, next time you just npm install the latest framework and all associated dependencies if you don’t understand the overhead and runtime consequences of implementing that code in an objectively shitty language you are basically ruining the web. It needs to be stripped back again. When your bundle.js ginormous you need to rethink your strategy.