Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Virtual Memory To Zero

Status
Not open for further replies.

CorBlimeyLimey

Technical User
Nov 23, 2004
355
0
0
CA
What actually happens when the VM is set to zero? Microsoft support does not recommend it be done yet the OS allows it. The system still functions and some people even claim they get better performance.

By setting the VM to zero, does that effectively just allow the OS/applications/processes to use the entire HDD as VM?

[Cheers]
 
If you set Virtual Memory to 0, then Windows would only use RAM memory and no pagefile on the hard disk.
You might want to monitor your max. Virtual Memory usage with something like Task Manager to see how high you normally go; then if you have at least that much RAM, I don't see a problem with turning off Virtual Memory.
 
Personally I see no problem in turning off virtual memory, unless you happen to use enough memory to require it (there's the problem). Actually when I try it, I usually don't see any difference between using it and not using it, so I don't worry about it. The exception I've seen (and done) is when you want to defrag the virtual memory page file and the defrag tool you have doesn't handle it. In that case, set virtual memory to 0, reboot, run the defrag, set it back. Usually when it recreates the page file you end up with a neatly non-fragmented page file.
 
I don't see an immediate problem and know of several people who run their PC with zero VM. But even with the VM set to zero, the "VM Size" in the Task Manager still shows VM as being used. So obviously the VM is not disabled by setting it to zero. In fact by setting it to zero I'm wondering if it effectively just removes the upper limit.

Hence my question;
"By setting the VM to zero, does that effectively just allow the OS/applications/processes to use the entire HDD as VM?"

[Cheers]
 
No - setting it to zero does just that - you won't find a pagefile on your machine. Several years ago I ran an XP machine with no pagefile (had 2GB RAM so thought, no need). Generally ok - no noticeable improvement in performance (there should be of course) - but got the occasional 'low on virtual memory' message (which I didn't and still don't understand). Having spent some time on MSKB it seems XP doesn't like running without a pagefile, so I put it back (though I didn't really see an explanation that I understood!). The other thing of course is the more RAM you have the bigger the default pagefile - which really doesn't make sense, apart from dumping the RAM to the pagefile (which is of course a debug technique we all use constantly).

Bottom line for me - I've given up! (never seen any noticeable performance difference whatever I've done) Just let windows manage it (as I've plenty of disk space) - might be different if that were in short supply.
 
Part of the problem with having no Virtual Memory is that some applications rely on it being there.

Generally these are older applications from the Win98/ME days and were due to sloppy programming.

As wolluf said with hard drives being so big now a days, giving up a gig or two to VM is no problem.

Greg Palmer
Freeware Utilities for Windows Administrators.
 
Probably the only useful reason for disabling virtual memory is when you want to test a program in a low memory condition. In that case you need VM off, otherwise you won't know exactly how much memory to eat up to get into a low memory state...
 
Thanks for all the responses so far.

The reason I ask is that I (and others) have found that using the /3GB switch with a VM size of 4GB (max and min), decreases the crashes experienced when working with large SolidWorks files. However, other people have apparently seen stability and performance gains with VM set to zero.

wolluf ... You are correct in stating that the pagefile.sys is no longer created when the VM is set to zero. I am currently running with zero VM but notice that the Task Manager > Processes > VM Size column is still reporting VM usage.

If the VM doesn't exist how can processes still report using it? What is it really reporting?

[Cheers]
 
This might answer a few questions. Here's a output from an old Windows-equivalent "mem" clone I wrote once upon a time. The terminology in the listing is the generally accepted Windows terminology as it appears in the SDK documentation on the issue.

Code:
Memory Reporting in Windows          
------------------------------------------------
           Memory Load: 49%
 Total Physical Memory:  536379392  (511 MB)
 Avail Physical Memory:  273408000  (260 MB)
Total Page File Memory: 1311625216 (1250 MB)
Avail Page File Memory: 1109422080 (1058 MB)
  Total Virtual Memory: 2147352576 (2047 MB)
  Avail Virtual Memory: 2131918848 (2033 MB)
================================================

If the VM doesn't exist how can processes still report using it? What is it really reporting?

It gets rather confusing to look at memory reporting under Windows unless you're really versed at the terminology. Virtual memory is the sum total of physical memory + page file. There's a confusion of terminology, which is quite evident in many of the posts in this thread. Virtual memory is not the page file, but the sum total of all memory available to an application.

Probably the only useful reason for disabling virtual memory is when you want to test a program in a low memory condition. In that case you need VM off, otherwise you won't know exactly how much memory to eat up to get into a low memory state...

To get a low memory condition, you really have to have a loader application that monitors these figures, allocates an amount of memory that leaves a low amount of virtual memory, and then will shell out and execute the program in question. For what I've seen in programming in Windows, you really have to eat through all the page file before you get a true "low memory" condition. So in that sense, disabling the page file can help, but with the huge amounts of memory in most systems, you really have to be able to "eat" up some memory to get a low-memory condition in most cases. (Just looking at something like Process Explorer really underscores that fact).

It might seem beneficial for this discussion to go disable my page file, and rerun the memory reporting app and post it.
 
Okay I did what I said in the last post. Here's one I don't quite get. As I understand, though, Windows needs a certain amount for page file.

Code:
   Memory Reporting in Windows          
------------------------------------------------
           Memory Load: 36%
 Total Physical Memory:  536379392  (511 MB)
 Avail Physical Memory:  342118400  (326 MB)
Total Page File Memory:  506322944 (482 MB)
Avail Page File Memory:  372195328 (354 MB)
  Total Virtual Memory: 2147352576 (2047 MB)
  Avail Virtual Memory: 2131918848 (2033 MB)
================================================

I guess Windows XP tries to "protect" itself in that respect, since I do know it requires page file memory for certain parts of its operation. The system read a 768MB page file allocation, which is the difference between the old report and the new (and what the virtual memory tab in the System control panel was reporting). The virtual memory still shows around 2GB available, which reflects the Windows limit of addressable memory. In simply removing the page file, I would assume the system assumes that it can make page file memory as it needs it.

Seems there's much that could be learned on this topic. My first thought is that perhaps setting page file limits would be more effective in the respect of limiting/eliminating page file space.
 
linney ... Thanks for those links. I had already found and pored through them but could not find anything referencing zero VM usage ... other than it not being recommended.

In simply removing the page file, I would assume the system assumes that it can make page file memory as it needs it.

That's my conclusion also. So I interpret the VM dialogue box options as;
"Custom size" > allows user to set min and max.
"System manged size" > allows the OS to use predetermined min and max (say 1.5 to 3.5 times) physical RAM.
"No paging file" > removes min and max restrictions. The OS uses whatever is necessary.



[Cheers]
 
I just checked my Virtual Memory settings and at the bottom of the dialog it says:

Total paging file size for all drives
Minimum allowed: 2MB

I don't know if that still applies if you select "No paging file", but it appears you can't use a custom size of 0.
 
If you have enough RAM there is no need for a pagefile.
That's quite a general statement, but it is true :)

This said, Windows does recommend to have a pagefile for the following condition: A blue screen of death. When this happens, all memory is dumped to the pagefile and a flag is set. At the next reboot, the OS then copies the memory dump from the pagefile.sys to "memory.dmp" in the system directory. This is also why MS recommends to have a pagefile "a lillte bigger" than the actual RAM. If it's smaller not all RAM can fit in pagefile.sys after the crash...

CU
G.
 
I tried disabling my Virtual Memory and everything seemed to run just fine, although I didn't notice any speed difference. Some programs like Adobe Photoshop will refuse to run if you disable Virtual Memory, so even if you have a ton of RAM, you still might want to specify a tiny pagefile just so programs like that won't freak out.
 
The 2MB minimum is to allow Windows to do a mini dump if everything gets FUBAR. It basically maintains the minidump of whats running on the HDD at all times, so in theory even if you suddenyl unplug your pc the dump will be there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top