Windows – Where does Windows 7 waste the RAM

memorywindows

Short version:

I have a system with 4GB of RAM, and another one with 8GB. Both running Windows 7, with paging file disabled. Now the strange part is that I can open the same number of programs before Windows 7 says there is no more memory for new programs. I would expect that with double the memory I could open more programs before running out of RAM.

Long version:

Something is not adding up to me. A few years ago I had a 32-bit system, running Windows 7, with 3 or 4 GB of RAM. I had turned off the pagingfile, because the system is faster that way.

Back than I could have open an instance of Visual Studio, MSSQL Management Studio, a couple of Firefox tabs, and a couple of Chrome tabs. These were the ones that fit in that 3 or 4 GB RAM.

Now I have a 64-bit system, running Windows 7, with 8 GB RAM, pagingfile turned off.

I can have open the same number of programs: an instance of Visual Studio, MSSQL Management Studio, a couple of Firefox tabs, and a couple of Chrome tabs.

Now my question is, how does this add up? I cannot really feel the difference between 4 GB or 8 GB of RAM. I've been thinking of buying more RAM, but the motherboard does not support more. But even than, I'm not sure It would make a difference, since it seems the RAM is wasted somewhere.

What can I do to identify where the RAM is allocated, and more importantly, what can I do to keep the RAM unallocated/so I can use it for my purposes, not for who knows what hidden Windows features.

EDIT:

I have turned off paging, because writing to the disk slows the overall performance, and I think that amount of RAM should be enough to live with.

I think there is a problem here, because if I open some other programs on my 8 GB system, than windows alerts me that there is not enough memory, and I should close some programs.

Best Answer

One way to see how the RAM is being used in the Windows 7 system, is with the program RAMMap.

Pic of RAMMap
Click for full size

You can see here that even with 32GB, a ridiculous amount of memory, that it all pretty much gets used up by the system too. In this here, about 4GB is in active use for all the stuff running, and the rest of it is filled with files in the cache. The file cache, or referred to as the system cache, or here it is known as the standby list.

Things in the standby list will be thrown out of RAM (deallocated) whenever more space is needed for other stuff. I will say there have been times when the cache deallocation has seemed slow, as if it was releasing in tiny amounts. Some updates of Windows 7 changed that, and it is better behaved after these updates.

RAMMap can also be used to clear these caches, and working sets and other stuff. RAMMap can manually clear out stuff in the cache, and it can manually clear stuff that should not be cleared, which will have to be loaded back in again (look in the empty menu item). You must refresh RAMMap's display manually to see it change.

RAMMap can also show you every file that is in all these different places, and lots of other data.


A more simple and built in way to see the brunt of the information is by using the resource monitor, and going to the Memory tab, where you get a view like this. (resmon.exe)

enter image description here

You can see this standby quantity at the bottom, which is just using the RAM for file cache, all still considered to be available memory, if needed for other purposes. See also the quantity they call available.

I am not going to say that the system is all perfectly using the RAM exactly the way every person would want to have used it, but it generally (at least) has some purpose behind what it is doing :-)

Win7 survives well on about 4GB of RAM, would be very happy in most uses with 8G, the rest will get used, but unless you have a great need, or run programs with a great need for it, you are not dying without it. Usually, people who really need more than the 4-8GB know why they do it.


Disabling paging:

I am not going to disagree or agree one way or another with any user's choice to disable paging. I ran that way myself at times. I will indicate a few things both learned from Windows makers, and learned the hard way.

1) There is no great need with large memory of today's computers to have the paging be 1x or 1.5x of the total memory. An adequate amount of paging, will be an adequate amount. If you have 16GB of memory, you surely do not need 24GB of paging. Exception, I think there are some Full Dumps that the full paging size is needed.

2) There are many programs in existence that will fail with errors that are very poorly described, when there is no set paging amount at all. Because of that, having at least a small 512MB space available for paging to disk can keep these programs from tossing up an error. So myself even after having run at various times without paging, I have a little one there anyway, because I am not giving any program another reason to error on me.

Yes, the system will end up using it (still) in ways that some users might find undesirable, generally only for unloading junk that you will not be using. I would agree with what people say about it on both sides, the program errors are a reason to keep it regardless.

Related Question