No, programs don’t typically expand to fill all available memory. They use however much they need, almost regardless of how much you actually have, and therein lies the source of most memory-related slowdowns.
There are lots of reasons one might want multiple gigabytes of memory, but it shouldn’t really be for something as simple as FireFox. I’d have to agree that someone’s a memory hog in that situation, but it might not be FireFox itself.
Your situation – everything just working with relatively low memory usage – is actually much more common.
Become a Patron of Ask Leo! and go ad-free!
Background: how good programs use memory
A well-written program doesn’t actually pay attention to available memory. Instead, it simply uses only the memory it needs, and no more. It also releases memory for use by other programs when it’s no longer needed. That’s an oversimplified definition of program that’s a good citizen.
If a good citizen program uses a lot of memory, there’s a reason, and in most cases, the reason is performance. Games are a good example – if written properly, a game can keep information in memory for significantly faster access than if it had to read that information from disk.
Other programs can often also take advantage of additional memory in the same way. Database programs are a good example. Programs like Quicken could fall into the same category. If you’re working with a large database of Quicken data, it’s conceivable that it could use a lot of memory. A good, but inexact indicator might be the size of the Quicken files themselves.
Background: how Windows handles memory
One of the features of most operating systems today is that they allow programs to request and “use” more RAM than is actually available memory on the system. By that, I mean that a program can request from Windows, say, 4 gigabytes of memory, and Windows could grant that request, even on a system that has less than 4GB available memory, or even less than 4GB of memory total.
Obviously, the program doesn’t really have direct access to RAM that doesn’t exist. Instead, Windows notices when a program tries to use some of that non-existent memory. When that happens, Windows shuffles things around, moving some of what’s in RAM to disk and reading back from disk some of what used to be in RAM. This whole (very complicated) process is what’s called virtual memory – using space on the hard disk to make it look like there is more available memory than there actually is. (Again, the disk space is not actually RAM, and is very separate from RAM – it’s just being used in a way that allows Windows to make it appear that there is more RAM.)
The problem with virtual memory is that disks are slow. No matter what type of disk you have – even solid state – actual RAM is always going to be faster. The net result is that if your computer finds itself running out of actual RAM because programs are requesting more RAM than actually exists, the system will get slower as Windows reads and writes virtual memory to and from the disk.
Reason 1: A program accidentally using all available memory
The most common case of an application using too much memory is what’s called a “memory leak”.
Recall that I said a good citizen program “frees memory for use by other programs when it’s no longer needed”. A memory leak is a fairly simple situation where a program loses track of the memory it has used, and neglects to free it for use by others. In other words, it’s a bug or mistake in the program.
In the cases you’ve heard about, I’m not pointing the finger at FireFox. While it could have a bug, as far as I know, it’s been very well behaved of late. More likely is that one of the add-ons installed has a problem, or even worse, malware of some sort is present. Unfortunately, browser add-ons are a common source of bugs and memory issues, as is malware.
While not totally benign, memory leaks are mitigated by the way Windows manages memory. If a program isn’t actually using all the memory it has requested, Windows might swap the contents of unused RAM into virtual memory in the paging file on disk, and free it for use by other applications. That actually just delays the eventual problem of the paging file filling up.
Virtual memory is given a maximum size to prevent the paging file, where virtual memory is written to disk, from consuming your entire hard drive in the case of a memory leak. No matter how large the paging file, however, if there’s a serious enough memory leak then not only will your computer run out of RAM and spill over into virtual memory, but eventually it’ll consume all of virtual memory. When that happens available memory is truly exhausted and many programs will misbehave, run exceptionally slowly, or even simply crash.
Even before the programs use up all of virtual memory, however, a memory leak or other high memory use scenario could absolutely result in your system running more slowly.
Reason 2: You might cause all available memory to be used
Programs themselves aren’t the only culprits when it comes to using too much RAM.
It could be you.
The number one reason that well-behaved software can end up using all available memory is pretty simple. Either:
- you’re trying to run too many programs at once
- you’re trying to do too much with the program(s) you are running
The first one is pretty self-explanatory: if you run several programs simultaneously, then they all will need some RAM. The accumulation of all programs requesting RAM could be more than you have installed, and thus could result in virtual memory being used and hence slowing down your system. The solution is also pretty simple: when you’re done with a program, make sure to exit it. When a program exits, all the memory that it had in use will be released for other programs to use.
The second one is a little less obvious. I’ll use a browser like FireFox as an example.
How many tabs do you keep open as you use your browser? As I type this my browser has 7 tabs open, each to a different web page. In fact, I also have a second browser window open (an incognito or in-private browsing session), with another tab open there as well. Each tab causes the browser to use more memory. If you open enough tabs, then your computer will eventually run out of RAM and start using virtual memory.
And to be clear, it’s not just browsers that operate this way. Almost any significant program will vary its need for RAM based on what you do: multiple documents in a word processing program; multiple photos in a photo editor; even the size of the files that you’re working with can impact a program’s desire for RAM to do what you ask of it.
Reason 3: Your installed programs might cause all available memory to be used
As we’ve seen, running too many programs can quickly cause all of your computer’s RAM to be used.
There’s a good chance you’re already running more programs than you think you are.
Many programs – many, many programs – install “auto-start” items these days. These are theoretically small programs that are set up to run automatically when you boot your computer or when you log in. If there are many of these, each with its own desire for some amount of RAM, they could be impacting the amount of RAM that’s “left over” for the programs you’re choosing to run yourself.
Now, auto-start programs aren’t inherently bad. Much of Windows itself is, in essence, an auto-start program, and many of its features are implemented as programs and services that start automatically. That’s as it should be.
Many programs you choose to install require some auto-start component – and thus some amount of ongoing RAM usage. Programs like your anti-malware tools, your software firewall, WinPatrol, DropBox, Evernote and others all provide important functionality that relies on some program running at all times.
However, some programs install what many feel are unnecessary components that auto-start. Those simply use resources, like RAM, for no real benefit. Unfortunately there’s no list I can give you of what’s safe to remove here, since it depends both on the programs you use, and how you use them. What’s a waste of resources for one person might well be a valuable feature for someone else.
Bottom line: more RAM is almost always better
So why would you want more memory than the programs you use require?
There are a couple of reasons.
Windows can use the memory for better handling of its own operations, such as reading and writing files to disk. In fact, adding memory to a slow system is one of the best ways to improve Windows’ performance.
Windows is a multi-tasking operating system, and as we’ve seen you can run more than one program at a time. I do this a lot. As I write this I have several programs running including my browser (with several tabs open), a text editor, a music player, a virtual machine running another copy of Windows, and a few other things. The more memory, the less impact all these running programs have on each other’s performance.