Plannedscape Postings

Image

Memory Hogs (Part 2)
Problem Child Example Of A Memory Leak Website

Posted by Charlie Recksieck on 2022-03-10
Last week we discussed memory hogs in general that take up too much CPU space on home computers. And we also got into how memory leaks from websites can be just as crippling. This week below, let’s look at one example of a problem child website.


An Example From A Website

Here's a real-world example of a memory hog website. I hate to call them out here because I absolutely love the site and game, but it's Sporcle. Despite me about to badmouth their programming, I love their trivia games generated by users. It's terrific. Here's a screen capture of one game, a Gene Hackman "Movie Resume" quiz. You type the name of the movie, and it fills it in as correctly answered. Try it.


It takes a lot of code to make everything happen on Sporcle. And as you can see in the screenshot above, there's also a lot of small ads and peripheral dynamic events happening on the page.

Well, here's something I've noticed as a player. If I leave a Sporcle tab up in my browser for a few hours, my computer gets horribly slow. Almost unusable which is saying something for a modern computer with 16gb of RAM.

Here's something alarming. I took a snapshot of my computer's resources, performance and memory allocation in a fairly normal state for me (8 visible apps running including a browser with 10 tabs open):


Now, doing nothing different whatsoever, I opened up a browser tab to a Sporcle game. That's the only thing different before taking the same picture from Task Manager just after opening Sporcle:


Even if this is all technically over your head, look at the CPU usage graph on each over the previous 60 seconds. You don't need a degree in computer science to see that Sporcle has some huge problems with memory.


How Can You Prevent This On A Website

OK, here's the other point of this article. If you have a website, you might be wondering, "How bad is my site on this front?"

Follow these instructions while in a Chrome browser to get a breakdown of which sites use how many resources:


We highlighted the Sporcle high usage in red, vs. the two other open websites in Chrome in blue. That's drastic and that's just one minute after opening Sporcle. It gets worse over time.


The Takeaway

Check your website or any other website to see how much RAM and other resources it's using up. If your site is not looking particularly good, then it's time for a code review.

We could certainly look at fixing something like that, as could most reputable software firms for hire. Keep a clean internet; be part of the solution, not the problem.