Where is my computer memory going?
posted 1/21/2012 2:31:53 PM
Is your memory storage lower than a five inch floppy disk’s? -Kyon
A common complaint I've seen from users concerning two products I want to hit:
1. Windows Vista/7
2. Mozilla Firefox
So let's explore these shall we?

The above is a screenshot of my total Windows memory usage captured at the time of this writing. I have a grand total of 4 GB of RAM to use and well over 50% of it is used up. Would you consider this to be a lot of memory consumption?
It actually is not. I have 4 main programs open (Firefox, Explorer file manager, Encoding software, and Opera) and a ton of background ones (Anti-Virus, Status on my personal server, f.lux are a few of them). The internet browser is the main one I'm using now. I could launch a game such as StarCraft II as well as X-Split (used to capture my gameplay) and really go to town on my resource usage quite comfortably.
So why is this not a big deal? After all over 50% means that I'm on the last 50% to use. Well here's where the quirks of Windows comes from. For starters we have what is known as the Page File. Every user here has one that acts as a temporary storage in addition to your RAM. It's part of your hard drive reserved to emulate RAM and can be found as a file named "pagefile.sys". Very few users have this turned off and they often have a ton of RAM installed.
If you turned the pagefile off, you would see your RAM usage spike and probably warn you that you are using way too much. This is also the reason for the phenomenon that your RAM always tends to use 50% whether you have 2GB, 4GB, or 8GB (because you have more RAM to take out of the pagefile).
Here's the big thing of why higher memory is preferred: Information stored and retrieved from RAM is always faster than information stored and retrieved from the page file. Once you install RAM, you can instruct Windows to not use a pagefile anymore and you will see a significant increase in performance (note: 4GB is not enough if you're thinking about it right now).
Windows does store up to 50% of your commonly used programs into memory so that it does load quickly. Instead of being reactive, your OS uses your memory proactive based on its own internal connection of most frequently used programs and functions (don't worry, the OS does not send this information to anyone unless you opt into the Windows Improvement Experience). If you do not like this at all, you can disable the SuperFetch service (make sure you know what you're doing before you go tinkering in the advanced options though).
So onward to the next piece of software known as Mozilla Firefox.
Yes we know quite well how much of a history that this browser has with memory complaints. Here's a thought though: Have you measured how much usage your browser uses without any addons installed?
Version 9 is the currently released version of Firefox and it is actually quite decent in management without any addons installed. In fact, the resource management rivals Internet Explorer (which on average consumes the fewest resources due to it and the OS being made by the same company). Version 12 further increases memory management but that's not quite ready for everyday usage just yet.
So where does this memory go? The most common enemy is the addons. The most popular addons such as Ad-Block and Greasemonkey often have higher-than-average code support behind it but even these programs have their problems every now and then. But these are the tip of the iceberg in terms of addons.
There are tons and tons of addons that many people use that are unknown and often have poor support (and sometimes even outright abandoned). Firefox loads these components into the main process (firefox.exe) when it is instantiated (such a fancy term that means startup). When just a single addon has one fatal memory leak, it leaks into this process resulting in one hell of a bloated firefox.exe in your task manager and none would be the wiser and just assume that the browser had a major hiccup.
Using the above theory, I have successfully crashed Pale Moon, Waterfox, other various branches of Firefox, Firefox on Linux, and many more. The Mozilla team is actually really good at refining performance than you think. If only the addon developers could keep up.
Note that I did state Pale Moon and Waterfox above. There are claims that these perform better than Firefox and those claims are indeed true. The reasoning behind it is that the people who maintain these versions use Microsoft specific tools to build the source code for Windows and only for Windows. This means that the compiler can implement several functions rooted deep with the OS can be used with the exe file that is generated resulting in even more refined management of resources. Whether you want to use these or the standard Firefox is up to you (the obvious advantage that Firefox has over those are faster updates and the ability to use pre-released versions which may or may not appeal to you).
And that is my little blurb on memory usage.