1

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.

5
  • 5
    Windows 7 isn't wasting your RAM, it's putting it to good use. RAM is only wasted if its unallocated. Why do you think there's a problem in the first place? What exactly happens when you try to open more programs than on your old 32-bit system? Does your computer slow down? What does Resource Manager show on the Memory and Disk tabs if/when that happens? Also, have you tried turning the page file back on (you know, like it's supposed to be)?
    – Indrek
    Mar 27, 2014 at 8:37
  • @DaveRook obviously he turned off the paging file because if there is writing to hard disk then it slows things down and the theory would be that if there is enough ram then you can do without a paging file. right or wrong that is obviously the theory behind him doing that isn't it.
    – barlop
    Mar 27, 2014 at 8:40
  • If I open more programs, than windows alerts me that my system is low on memory, and I should close some programs. I think there is a problem, because I can open the same amount of programs regardless if it's 4 GB or 8 GB in my system. I would expect to be able to open more with 8GB.
    – jaraics
    Mar 27, 2014 at 8:42
  • Jaraics, you didn't mention that in your original post and that is pretty fundamental to your question
    – Dave
    Mar 27, 2014 at 8:44
  • 1
    Turning off the paging file does not eliminate paging to and from disk. It simply constrains paging to be exclusively to mapped files. Sep 29, 2014 at 21:44

4 Answers 4

4

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.

7
  • Thank you for your answer, especially pointing out that even on 32GB, it's all used up :) Can you give more details about which windows update fixed the releasing issue?
    – jaraics
    Mar 27, 2014 at 9:06
  • @jaraics: watch the video i stated. the dude talking about the ram wrote the sysinternal suite, rammap as well. windows releases the ram based on several criteria (there are multiple subcategories in the "standby" section)
    – akira
    Mar 27, 2014 at 9:18
  • Microsofts own site could not give me information on which update it was :-) I would like to know myself. There was some info i found about standby being releaced in bigger chunks (they used the word blocks). But I have not yet been able to track down user understandable info.
    – Psycogeek
    Mar 27, 2014 at 9:25
  • 1
    @magicandre1981 RamMap crashed on me when I tried to do an export/save. I had taken some screenshots of the tabs: bit.ly/1feY538
    – jaraics
    Mar 31, 2014 at 15:44
  • 2
    modified is too large. And without pagefile Windows can't move them to the pagefile. Close Chrome while coding and use the WebSearch addon to search here on stackoverflow from inside the VS: channel9.msdn.com/coding4fun/blog/… Mar 31, 2014 at 16:03
3

I have turned off paging, because writing to the disk slows the overall performance

Well, one, you haven't "turned off paging". You can't. You have removed the paging file, but paging still occurs (to exe's, dll's, mapped data files, etc.) - look at your performance counters if you don't believe me.

and I think that amount of RAM should be enough to live with.

Right... You think that, even though you're getting "out of memory" errors. Those errors are happening because you don't have a high enough "commit limit". The commit limit is the sum of RAM size plus pagefile size. Put your pagefile back and you'll find these errors will go away. You could also add more RAM, but the pagefile space is MUCH cheaper. And if you do have enough RAM, it will not slow your system down.

1

Do yourself a favour and watch this:

http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/WCL405

TL;DW: Every byte that you want to copy / work on / listen to / watch on your screen / send over the network etc goes through your RAM. Every sane OS caches as much as it can. Unused RAM is just useless. But again: do yourself a favour and watch Mark explain how Windows uses RAM.

5
  • How does this explain that I could open the same number of programs on 4 GB vs on 8 GB? I don't mind, Windows can use whatever it wants to cache, but then when I need the memory than let it go, rather than stating that there is not enough.
    – jaraics
    Mar 27, 2014 at 9:01
  • 2
    there are a lot of possible explanations: ram fragmentation, bigger pointer-size (overhead), different versions of the programs you use which handle things differently (eg, browser like to store things in cache-files. these cache files are also kept in ram. if a browser changed the way it handles the cache file it might prevent the OS from releasing that file from the ram). ram fragmentation for example is quite common: program 1 needs x amounts of tiny chunks. when program 2 launches, there might be not enough bigger chunks left, no matter how many free tiny chunks are left.
    – akira
    Mar 27, 2014 at 9:22
  • @akira "RAM fragmentation" does not occur. There is no such thing. That is one of the huge advantages of virtual memory. The "chunks" are always the size of a page, and you don't need them to be contiguous. Jul 16, 2015 at 23:28
  • @JamieHanrahan: maybe i used the wrong phrase: i mean this: stackoverflow.com/questions/3770457/… ... and it is real.
    – akira
    Jul 17, 2015 at 7:16
  • That Q is talking about fragmentation of a process's heap - the stuff you allocate with malloc(), new(), etc. That is not "RAM fragmentation", nor will it cause the "out of [virtual] memory" pop-up (though it will cause apps' alloc calls to fail). By contrast, "RAM fragmentation" would refer to physical memory. It does occur, but it happens all the time, and 99.9% of the time nobody cares, not even the OS memory manager. That's one of the beauties of virtual memory. n.b.: Terminology is EVERYTHING in this business, and the distinction between virtual and physical memory is absolutely key. Jul 17, 2015 at 10:58
0

The purpose of RAM isn't speed per-se, it's more about resource.

For example, if your never consume 1GB RAM, then it won't matter if your machine has 4GB or 400GB since you'll never utilise it.

I would guess, based upon what you have open, you're only ever using may be 2GB - 3GB RAM and as such, your 4GB machine coped easily.

Windows will automatically allocate and de-allocate memory based upon what you're doing. So, even if you feel you are only consuming 1GB of memory, maybe a Windows task will spin off and consume another 1GB... It won't matter since it's well below the threshold of your machine.

Since you have VS installed, create a program which has a memory leak and let it run - eventually, you should get an out of memory exception. This is one example when the amount of RAM becomes important. Obviously the more RAM you have, the more resource you have to consume and as such the longer it will take to get that exception.

If you want to run programs faster, then a faster CPU (processor) is key but, some programs can only run as fast as they do. I don't think you'd see much difference between a 4GB machine and an 8GB machine whilst typing in a line of text into notepad.

To find out what programs are using your resources, open up task manager and review the processes tab. Here, it shows both CPU and Memory.

4
  • 1
    You seem to be spot on, but I would also add, that not all memory is cleared at the time when it is not needed anymore. Big part is cached and only freed when some other program requests more memory.
    – ek9
    Mar 27, 2014 at 8:37
  • @Dave, I would like to advise using Process Explorer from brilliant Windows Sysinternals instead of standard Task Manager.
    – Merzavets
    Mar 27, 2014 at 8:49
  • @Merzavets, you may want to add your comment to the OP - it's possible the person who made the OP may miss this comment since where it currently lives :)
    – Dave
    Mar 27, 2014 at 8:51
  • @Dave, thank you :-) Hope that "The post author will always be notified of your comment" as mentioned below ;-) Sorry, would you explain what abbr OP stands for? Original poster?
    – Merzavets
    Mar 27, 2014 at 10:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .