Windows-4-GB-More-RAM

This article is written for 32 bit operating systems. Unless explicitly mentioned, Windows 7 and Vista refers to the 32 bit edition of the respective Operating Systems.

Couple of months back, I had blogged about a peculiar Windows 7 issue which could cause a BSOD (Blue Screen of Death) if the system had 4GB (or more) RAM. I managed to find a fix for that issue. But, I had another minor niggle to figure out. Although I paid for 4GB of RAM, Windows refused to use more than 3GB. If you have 4GB or more RAM then you are probably familiar with the following screen.

Windows-7-Vista-3-GB-Usable

Computer Properties displayed installed memory as 4GB but at the same time stated that only 3 GB is usable. So, where did the remaining memory go?

As it turns out, chunks of your RAM are reserved for various purposes and are not available to the operating system. For example, PCI Express support will reserve 256-768 MB depending upon the graphics adapter. Due to this Windows always displays less than 4 GB RAM as the amount of usable memory. Depending upon your hardware, anywhere between 2.75 GB and 3.5 GB of RAM will be available to the OS.

But, what if you have more than 4 GB RAM? Even on a system with 32 GB RAM, 32 bit editions of Windows will display less than 4 GB of memory. This is a known limitation of the Windows Vista and 7 x86 editions.

Microsoft claims that it is not their fault and is instead a limitation of the 32 bit architecture. At first glance this seems correct. 32 bit processor using 32 bit registers should be only able to address up to 4 GB of RAM (232 = 4G). However, this is not actually true. The main reason being a feature called Physical Address Extension (PAE).

PAE makes it possible to address more than 4 GB of memory using 32 bit registers, since the registers aren’t used to store the physical address. Instead, the registers store linear addresses, which are mapped to physical addresses using the page table. This feature has been available since the days of Intel Pentium Pro. In x86 processors additional address lines are provided so that up to 64 GB can be addressed when using the PAE mode. If you want to learn more about Windows memory addressing, go through Geoff Chappell’s notes.

Windows Vista and 7 have two kernels – one which doesn’t use PAE and one which does. They are NTOSKRNL.EXE and NTKRNLPA.EXE respectively. Both of them reside within the Windows/System32 directory. Can you guess which one you are using? If you have a modern machine, then chances are that Data Execution Prevention (DEP) is enabled in your system and in that case you are already using the kernel with PAE enabled.

How to Enable More Than 4 GB Memory

Before getting started, keep in mind that this patch involves modifying the kernel. Do no proceed unless you are confident. Most security products will identify these patches as malicious since they modify the Windows kernel.

Download the appropriate patch for your system (links at the end of this post). I haven’t tried the Windows Vista patch, but I can confirm that the Windows 7 patch works. The Windows 7 patch is in Russian language. To begin patching click on the big button (refer to screenshot). After this a command prompt window should appear. Press Y.

On restarting the system, you should see two entries in the Windows Boot Menu – one being the older configuration and the other being the one with support for more than 4 GB RAM. If you don’t want to be prompted every time, press Win + R, type msconfig and hit Enter. Under the Boot tab, reduce the timeout value (to something like 3 sec). If you wish, you can simply get rid of the older configuration by deleting it. But I wouldn’t recommend this. If you get a water mark (Test Mode) on your desktop after restarting, type mcbuilder.exe in the Start Menu and press Enter.

Windows-Vista-4GB-RAM-Patch-
Windows Vista Patch
Windows-7-4GB-RAM-Patch-2
Windows 7 Patch: Step 1 (Click on the button)
Windows-7-4GB-RAM-Patch-1
Windows 7 Patch: Step 2 (Press Y)

This patch will allow the OS to use more than 4 GB of memory. However, it does have a limitation – more than 3 GB of memory cannot be allocated to a single application. This patch is mainly targeted at systems with more than 4 GB of RAM. However, in some cases installing this patch on 4 GB systems will also lead to an increase in available memory (which may not necessarily result in performance improvement). This may appear to be a bit strange since Windows 7 and Vista are technically capable of addressing up to 4 GB of memory. Obviously, there is a logical explanation for this behavior. But, I won’t discuss it here. Refer to Geoff Chappell’s notes on Physical Memory Map if you wish to explore the issue in detail.

Warning: The patches described in this article are kernel patches. They may result in unexpected hardware issues and expose your system to malicious exploits.

Download Links:
4GB Memory Patch for Vista 32 bit (SP1 and SP2)
4GB Memory Patch for Windows 7 32 bit

Source: http://www.pallab.net/2009/12/30/enable-more-than-4gb-memory-in-windows-vista-7/

Related: http://www.raymond.cc/blog/make-windows-7-and-vista-32-bit-x86-support-more-than-4gb-memory/