IncreaseUserVa
From ProPHOTO WIKI
|
This article covers an advanced topic and improper usage of these settings may cause adverse effects. Please carefully read the entire contents of this article before implementing any changes. |
Contents |
Introduction
In their default configuration, 32-bit versions of Windows limit individual programs to using no more than 2GB of virtual memory at any given time. As many photographers are now buying computers with upwards of 4GB of memory, this limitation can prevent their systems from taking full advantage of that additional RAM. To combat this problem, previous Windows OSes (including Windows XP Professional) provided the /3GB Switch to expand the amount of memory available to each program. Windows Vista provides this option as well, however as the boot process has been changed for this OS it must be enabled in a different manner.
Warning: This option is an advanced feature of these Operating Systems and is not intended to be used lightly. It carries with it a number of significant caveats, and the user should be extremely careful when playing around with this switch.
How it Works
To understand how the IncreaseUserVa option works, one has to understand the difference between virtual and physical memory. Programs running on Windows (and pretty much all modern OSes) work within their own block of virtual memory space. That is, each program has its own isolated set of virtual memory addresses to work within - when that program attempts to access data at a specific address, the OS and processor dynamically translate those virtual addresses into physical ones. This abstraction of memory access provides a number of advantages over direct access, however they are beyond the scope of this document. Please see the virtual memory article for more information on this topic.
This set of virtual addresses consists of the integers 0 to 4,294,967,295 - if each of those addresses are mapped to a single byte of memory, the program would be able to access up to 4GB of virtual memory. Unfortunately, there are other things that these addresses must be used for (such as communication with the underlying OS and hardware), so there are additional constraints in force.
In order to facilitate these functions, a portion of these virtual addresses are designated as 'kernel space' and shared between all programs running on the system. Those programs can access the resources mapped into these addresses in order to communicate with the rest of the system. The details of how this memory is actually used is beyond the scope of this document, however it is not required to understand the basic operation of this switch.
In its default configuration, Windows divides the range of virtual addresses in half and provides the lower 2GB portion (0-2,147,483,647) for the use of the program, and the upper half (2,147,483,648-4,294,967,295) to act as the shared kernel space (mentioned above). This is where the IncreaseUserVa option comes into play - it shrinks the set of addresses assigned for kernel use so that more is available for each process' use. As such, each program running on the system potentially has more room to store data.
Potential Issues
The problem with this, however, is that few people know about this feature and only a fraction of those users actually make use of it. As such, many developers of device drivers simply assume that they have the standard 2GB block of kernel address space to work with and hard code their drivers along those lines (which is admittedly true for the vast majority of installations). If you shrink that space down, any drivers making this assumption are going to experience problems. At the very least it will generally lead to a very unstable machine, at the worst it will prevent the machine from booting at all.
The most common culprit for this type of problem is the video card. Modern graphics cards often have large quantities of onboard memory that must be mapped into the virtual address space. This process requires a sizable contiguous block of addresses within the kernel space, so the 1GB limit can become a serious liability. If there is insufficient space, the driver will often fail to load and cause the system to crash during the boot up phase.
Fine Tuning
Fine tuning the amount of memory assigned to the user space often allows users to bypass many of the issues listed above. While IncreaseUserVa allows the user to assign up to 3GB of space, it can also be set to any value between 2048MB and 3072MB. In many cases, a threshold can be found that prevents driver problems while still providing software with additional working space. Finding the appropriate value can, however, take some work.
Limitations
It is important to note that software must be specially written to take advantage of this feature. Software which is not explicitly marked for this mode will still be limited to the conventional 2GB boundary and will not see any benefits from it being enabled. As such, users should be aware that the benefits of this switch are limited.
While most software does not support this feature, the one notable exception is Adobe's Photoshop CS2. When IncreaseUserVa is used, this version of Photoshop will take full advantage of the additional memory space and can see improvements in performance when working with large files. It is for this reason that many photographers have elected to take advantage of this switch.
Compatibility
Other Issues
As noted above, the ability for a system to function in this mode is critically dependent on the drivers and hardware in use. As all it takes to cause problems is a single device driver or piece of hardware, there is no way to be 100% certain that the switch will work. As such, the user must either find an identical configuration that has been explicitly tested with it or set things up and test it out first hand.
Due to these issues, it is generally recommended that users buying new computers focus their energy on seeking compatibility with 64-bit OSes. While this switch will work on many systems, there is no absolute guarantee that it will function.
Testing
It should be noted that many of the adverse effects caused by this switch will be triggered regardless of how much physical memory is in the system. As such, for users considering the addition of more memory to their systems it is possible to test this switch out before performing the upgrade. While it won't provide any performance benefits until the new RAM is added, it will help to determine if there are any potential issues with the switch.
Using the Switch
BCDEdit
While older versions of Windows used a simple text file called boot.ini for their low-level options, Windows Vista uses a new binary configuration file that must be edited by a program called BCDEdit. In addition to IncreaseUserVa, this program allows the user to control a number of other low-level options that will be executed at boot time. BCDEdit is installed automatically with the OS, and can be accessed by launching a DOS prompt from the Start menu.
Activating IncreaseUserVa
Warning: - As mentioned above, please note that activating this switch may prevent the machine from booting properly. As such, make sure that you read through this entire document before following these steps. It is strongly recommended that you write down the instructions in the following section for recovering from a failed boot.
- Go to the Start menu and type 'cmd' in the search field.
- When cmd appears in the applications section above, right click on it and select 'Run as Administrator'.
- If prompted, click 'Allow' to permit elevated permissions on this DOS prompt.
- When the DOS prompt is shown, type the following to back up the current settings:
bcdedit /export "C:\BCDBackup"
- If there were no errors, type the following command:
bcdedit /Set IncreaseUserVa 3072
- Once the change has been made, type 'exit' to close the window.
- Reboot the computer and it will attempt to boot with this setting activated.
In Case of Trouble
If the computer fails to boot after making this change, you likely have a driver that will not function in the standard IncreaseUserVa mode, so you will either have to disable the switch or fine tune the setting. To reverse the change, you will first need to restart the machine in Safe mode. To do this, perform the following steps:
- As the computer restarts, but before Windows launches press the F8 key to get the boot menu (Windows may do this automatically for you).
- Highlight the 'Safe Mode' entry with the up and down arrows and press enter to begin booting.
- Windows will now boot into safe mode, with the IncreaseUserVa switch temporarily disabled.
- Go to the Start menu and type 'cmd' in the search field.
- When cmd appears in the applications section above, right click on it and select 'Run as Administrator'.
- If prompted, click 'Allow' to permit elevated permissions on this DOS prompt.
- When the DOS prompt is shown, type the following to restore the previous settings:
bcdedit /import "C:\BCDBackup"
- Once complete, type 'exit' to close the window.
- Reboot the computer and it will start up with existing settings.
If you would like to fine-tune the settings, the IncreaseUserVa option allows you to specify an exact amount of memory to allocate to the user mode. To do this, perform the following steps:
- As the computer restarts, but before Windows launches press the F8 key to get the boot menu (Windows may do this automatically for you).
- Highlight the 'Safe Mode' entry with the up and down arrows and press enter to begin booting.
- Windows will now boot into safe mode, with the IncreaseUserVa switch temporarily disabled.
- Go to the Start menu and type 'cmd' in the search field.
- When cmd appears in the applications section above, right click on it and select 'Run as Administrator'.
- If prompted, click 'Allow' to permit elevated permissions on this DOS prompt.
- To set the amount of memory allocated for user mode, type the following command but replace n with a value between 2048 and 3072:
bcdedit /Set IncreaseUserVa n
- Once the change has been made, type 'exit' to close the window.
- Reboot the computer and it will attempt to boot with this setting activated.
This switch allows you to adjust the exact amount of memory allocated to the user mode, so it can often overcome problems that the standard configuration runs into. There is no guarantee that this will resolve the problem, however, so you may need to return to the standard configuration.
Instability
Note that even if the machine is able to boot with this switch enabled, it can still potentially cause stability issues with the machine. After making this change, users should carefully monitor the stability of the machine to ensure that it has not been adversely effected. While this setting typically causes very obvious symptoms when there is an issue, it does periodically trigger more subtle signs.
Common Misconceptions
As the underlying manner in which this switch operates is rather complex, there are a number of misconceptions that many users have with its operation. A few of the more common ones are listed in the following sections:
Without this switch, the system will only use 2GB of memory
The IncreaseUserVa switch controls the virtual memory space allocated to each program. It does not have any effect on the way that the physical memory within the system is handled. That is, this switch controls the amount of memory that individual programs can make use of, not the amount of memory that the system can use.
For instance, take the example of a computer with 4GB of RAM installed and IncreaseUserVa disabled. If you ran a single memory intensive program, it would indeed be limited to using only 2GB of that RAM. If, however, a second program was launched on that machine it could use up to 2GB of its own memory. While each piece of software is limited to 2GB, the two programs combined can make use of all of the memory available to the machine.
Alternatives: 64-bit Versions
One way to work around the limitations listed above is to use the 64-bit versions of Windows Vista on a capable computer. As kernel-mode components had to be rewritten for the 64-bit versions of the OS, they are designed to work within a much larger memory space. As such, the functionality provided by this switch is automatically available to any 32-bit software that requests it (such as Photoshop CS2). As this does not require any manual intervention, the user does not need to concern themselves with these details so the use of large banks of memory is much simpler.
It is important to note that this OS requires drivers explicitly written for the 64-bit platform. As such, users should be careful to ensure that drivers are available for all of the devices they would like to use with the machine. While this is much less of a problem than it was a few months ago, there are still a few devices that aren't supported by the 64-bit variants of the OS.
See Also
- Virtual Memory - The mechanism that is used by modern systems to dynamically manage memory. This switch controls several facets in the operation of this system.
- /3GB Switch - The equivalent option used in older versions of Microsoft Windows. Fine tuning must be performed with the associated /USERVA Switch.
External Links
- Windows PC - Selection, Configuration and Use Forum - A place to ask any further questions that you might have on this topic.
- Microsoft: Memory Support and Windows Operating Systems - Brief explaination of the /3GB mechanism on Microsoft's website.
- Adobe: Memory allocation and usage (Photoshop CS2) - Adobe's whitepaper on memory management within Photoshop CS2.

