Who Moved My /3GB?

Who Moved My /3GB?

  • Comments 12
  • Likes

Last week, while planning blog posts for April, it occurred to me that although we had provided information on using the /3GB switch in the boot.ini file on Windows Server 2003, we hadn’t followed up with a post about how to implement this same functionality in Windows Vista and Windows Server 2008.  Beginning with Windows Vista, boot configuration parameters are stored in the Boot Configuration Data (BCD) store.  We’re not going to go into details on the BCD Store, or the utility to manage the BCD Store, BCDEDIT.EXE.  If you want to read more about it, there is a BCD FAQ on TechNet that goes over the new functionality.

Configuring the /3GB functionality using BCDEdit is not a difficult task.  You’ll need Administrator privileges, and an elevated command prompt.  The command itself is actually very simple:  BCDEDIT.EXE /Set IncreaseUserVa <value>.  <Value> in this command represents the number of megabytes that a user-mode process can use.  If you think of 1GB as 1024 MB (2^10) then to allow 3GB of memory we allot 3*1024 MB = 3072 MB.  Thus our command becomes BCDEDIT.EXE /Set IncreaseUserVa 3072.  We can tune this value as needed, just like we did when we combined /3GB and /USERVA in the boot.ini.  To set /3GB /USERVA=2970, we would BCDEDIT.EXE /Set IncreaseUserVa 2970.  Fairly straightforward, right?

Let’s see what it looks like.  I ran through this scenario on a Windows Vista Enterprise SP1 machine.  First, let’s use Process Explorer to take a look at the default configuration where the Virtual Memory space is split equally – 2GB for kernel mode, and 2GB for user mode

image

And then let’s take a look at this information in a debugger:

image

Now that we have a decent idea of what our baseline system looks like, let’s set the IncreaseUserVa value to 3072 (3GB).

BCDEdit_Command

And we can see below that our value has been set in the BCD Store.

image

Following a reboot to allow the change to take effect, let’s look at our Process Explorer and Debugger information again:

image

image

As we can see, our Paged Pool limit has decreased by around 50% and our free Page Table Entries have also decreased significantly.

Should you find yourself in a situation where you need to reset the IncreaseUserVa value back to a default setting on a 32-bit system you can either re-run the BCDEDIT.EXE command and set the IncreaseUserVa value to 2048, or … you can remove the user-defined value from the store as shown below:

BCDEdit_Command_undo

Remember that whenever you modify this value, you will need to reboot your system for the change to take effect.  And with that, we’ve reached the end of this post.  Until next time …

Additional Resources:

- CC Hameed

Share this post :
Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Hi CC,

    Per my understanding, when we use /3GB, the kernel resources will be cut short of the original value (depending on the value specifed for Userva.). But in the screenshots above, the Pagepool and Free SystemPTEs are reduced but not NonPaged pool.!!

    Can I get some clarity on this ?

  • Hi V.rajeesh,

    Good catch on noticing the anomoly. What you are seeing is an effect of the new kernel tuning in Windows Vista and Windows Server 2008. Previously, the OS would allocate it's kernel resources at boot time and the number never changed. Since it had to make the allocation determination at boot, you would sometimes end up running out of a certain resource while others were fine.

    With the newer OS's, kernel memory allocation is dynamic, and can grow as it is needed (until you run out of kernel of course). So, the number being shown above is what is being reported as the 'limit', which on 2003 for instance is a hard number. On Vista\2008, the theoretical limit is reported since there is no hard limit.

    The following previous posts talk about memory allocations and memory handling in Vista\2008 specifically:

    http://blogs.technet.com/askperf/archive/2008/02/07/ws2008-memory-management-dynamic-kernel-addressing-memory-priorities-and-i-o-handling.aspx

    http://blogs.technet.com/askperf/archive/2007/03/07/memory-management-understanding-pool-resources.aspx

  • Hi Tim,

    Thanks for your reply, however if it is the LIMIT that is diplayed against the NPP, then even the PP and the SysPTEs also should display the LIMITS.

    I understand that the kernel resources in Windows 6 are dynamic against the hardcoded values in Win 5.xx. In that case when the LIMIT is displayed against the NPP why not against the PP and PTEs as well.

    I went through the links you provided. It is clear in that blog that the MM is Dynamic in Vista and 2k8 and I completely understand the concept. However I'm still confused about the screenshots and I'm doubting on my skills here.

    Please educate me.

    Thanks,

    Rajesh

  • Well, the PP and NPP are both displayed as limits, but in this case the limits are different, and I understand can certainly be confusing.

    What happens is this: In Vista and 2008 (32-bit), the entire kernel address space is open to whatever needs it, as opposed to the old way where the different spaces were allocated at boot time and not changeable. The caveat to this is NPP, which is limited to 75% of RAM, since it cannot be paged. So, PP and NPP will both show the maximum amount they could theoretically allocate, up to the 2 GB limit. On a Vista machine with 2 GB of RAM installed, the numbers will show this:

    PP   2,093,056  (this is the full 2 GB theoretical limit)

    NPP 1,554,412  (this is 75% of the installed RAM)

    However, when you enable UserVa settings to reallocate some of the kernel memory, the amounts of course change since your kernel is smaller. On the same Vista machine after setting UserVa=3072:

    PP   1,044,480  (this is the full 1 GB theoretical limit)

    NPP 1,044,460  (this is also the full 1 GB theoretical limit)

    The reason NPP drops in this case is that the theoretical limit is less than the old limit of 75% RAM. The reason the numbers in CC's post above do not seem to change for NPP is that the machine he tested on had just 1 GB of RAM in the first place. Because of this, the 75% limit for NPP was smaller both before and after enabling UserVa. The doc CC referenced in his post above goes into all of this and more. Hope this info helps.

  • Is this necessary for 64 Bit Vista\Server 2008 systems?

  • Hi Pete,

     No, just like in Server 2003, this only applies to 32-bit systems. In 64-bit systems, the virtual memory limits are so high that these settings simply don't apply. You could insert the value using Bcdedit, but it won't do anything.

    Tim

  • Thank you for the information provided was very useful, thanks to my job

  • Will this work on 2008R2 (64 bit) for a 32 bit app ?

    If I have a 32 bit app running under a 64 bit MS Server 2008.  Can I use this method so I am not limited to 1.5 GB ?

    thanks.

  • Hi Charles,

     No, neither /3gb nor IncreaseUserVa apply at all on a 64-bit OS. When using a 64-bit OS, the limits for 32-bit apps are already maxed out beyond what you would get using these settings. You should not be running into any 1.5 GB limit on a 64-bit box.

    Tim

  • Hi,

    I am running Win 2008 Enterprise 32bit on DualXeon @2,4 and 3GB of RAM. I am running on it application that uses MS SQL 2008. My SQL instance often goes beyond 1,6GB and application hungs (not SQL).

    Questions:

    1. When I run Process Explorer on my machine Page Limit has no values it says "no symbols"

    2. Will 3GB switch increase performance?

  • Hi Tim!

    I saw that you wrote that chaning the bcdedit /set increaseuserva from 2gb to 3gb Have no effect on 64bits. But if I did change it ( Like I accidently did ) does it decrease performance in some way, or it goes on the regular way as if I never did it? Thanks for the help! ;)

  • Hi, I changed my IncreaseUserVa to 2500 (without checking what my standard IUV was) so now I cant run bf3 ;(

    Do you know how I reset my IUV to standard? D: