You are inside a passionate computer engineer's lab...
Proceed at your own risk...

Look for something inside my Lab...

How to use more than 4GB of RAM with 32-bits Windows OS?

Actually, I am still running the good old Windows XP 32-bits system on my 4GB RAM laptop. And as some of you may know, Windows 32-bits OS can use a maximum of 4GB of RAM due to the addressing space constraint.

In practice, my Windows XP only allows me to use a maximum of 3GB of RAM for my programs, while 1GB is restricted to the kernel. This, given that I enabled the PAE (Physical Address Extension) option for the kernel.

Anyway, I found a solution that enables me to use the whole 4GB for my applications, and that enables in general to use even more than 4GB of RAM with a 32-Bits Windows OS.

The trick is easy. Among the memories used by the system there is the RAM and the disk swap space (commonly C:\PageFile.sys) and other types also. I will let Windows use the 3GB of RAM as normal. Then I will make it use the last 1GB of RAM as a swap space, as if it was on disk. But to do this I will have to create a RAMDisk. A RAM disk is a virtual volatile disk that exist only in RAM. This enables me to regain the 1GB RAM space and use it for memory pagination operations. So nothing is lost.

To do so, I use a program called VSuite Ramdisk. This program enables me to create a new virtual disk drive in "My Computer" folder that enables me to access the 1GB RAM space that the OS cannot access natively.

You can download the program from here. The free edition does well. Once installed, you have to configure it to make the new RAM drive. Here is how:

1. Open the program.
2. Click on "Options" on the left tab bar.
3. Check the option "Enable OS Invisible Physical Memory".
4. Click on "Ramdisk" on the left tab bar.
5. Look at the option "Use OS Invisible Memory", next to it there is the total space of the RAM the 32-bits OS cannot use. Note down that number, I will called it OSIRS.
6. Choose the options for the new RAM drive. Personally I chose:
- Disk Size: 892MB
- Drive Letter: M:
- File System: FAT. You will need to use FAT32 if you have 6GB or more of RAM.
- Volume Label: RAMDISK
The rest of the options I kept for the default.
7. Click on "Add" button.
8. Click on "Exit" button.

Now you have a new drive in your computer called RAMDISK accessible as M:. Because of its volatile nature, this drive does not retain any files written into it once the computer is rebooted or shutdown.

Now, we will tell Windows to use our new drive as a container for its swap space. Here is the procedure:
1. Right click on "My Computer" and select "Properties".
2. Click on "Advanced" tab.
3. Click on "Settings" button inside "Performance" frame.
4. Click on "Advanced" tab.
5. Click on "Change" button inside "Virtual Memory" frame.
6. Select "M: RAMDISK" from the list.
7. Choose the option "Custom size" inside "Paging file size for selected drive" frame.
8. In "Initial size (MB)", type the number OSIRS minus 6. For example, in my case I type "886".
9. Type the same number in the text field "Maximum size (MB)".
10. Click the button "Set".
11. Click the button "OK".
12. Click the button "OK".
13. Click the button "OK".

Now, Windows will use the RAM disk every time it runs out of those 3GB RAM memory. Windows will not tell you that it uses the full 4GB (or maybe more in your case), but it will effectively do it.

Windows is still configured to use hard disk space to do paging operations, and because of this, some might argue that Windows might use the hard disk to swap pages of memory, instead of the RAM disk, which makes our trick meaningless, but here some ways to get around it:
1. You can remove the swap space from all other drives except the RAM disk. This will make dead sure Windows will use the RAM disk for memory page swapping. But this limits the virtual memory size to exactly 4GB, and in deed disables disk paging. This is not recommended.
2. Reduce the disk space used on other drives. This is my adopted solution. I limit Windows to only 1GB of hard disk space (on C:) in addition to the 886MB space of the RAM drive. This gives me about 5GB of virtual memory. By experience, I have never got in an out of memory situation since I bought my laptop (This means about 5 months of usage without a single out of memory situation). This proves that the 5GB are really sufficient for my jobs. The amount of hard disk space you need depends on your set of applications and how you use them. You can test for yourself to find a suitable configuration, you can always higher that size given that you have free space on the hard disk.

That's all. Thank you for your attention. I wish I have given something useful.

No comments:

Post a Comment