How to make GiD use more than 2GB on Windows XP?
Two steps must be followed to achieve this: configure Windows so that it lets a process use more than 2GB and enable the application to use more than 2GB.
-
Configuring MS Windows XP: add the flag /3GB to the Boot.ini file. To do this just open the Control panel , click on the System icon, on the Advanced options panel, then press the Configuration button of the Start and recuperation section. In this window click on the Edit button inside the System start section and the Notepad will pop-up with the Boot.ini file opened. In this file there should be a line like this:
multi(0)disk(0)rdisk(0)partition(1)/WINDOWS="Microsoft Windows XP Professional" /fastdetect
just add the /3GB flag at the end, like:
multi(0)disk(0)rdisk(0)partition(1)/WINDOWS="Microsoft Windows XP Professional" /fastdetect /3GB
Now the file must be saved, and MS Windows restarted
-
Enabling the application: set the IMAGE_FILE_LARGE_ADDRESS_AWARE in the .exe file of the application. This can be accomplished in two ways:
-
linking the program with the flag /LARGEADDRESSAWARE - go to the Properties of your MS VisualStudio 2003 application project and look for the Linker section and the System branch. In the combo-box menu with label name Enable Large Addresses select the entry Support Addresses Larger Than 2Gigabytes (/LARGEADDRESSAWARE) .
-
setting this bit directly in the executable - using the program editbin.exe located in C:/Program files/Microsoft Visual Studio .NET/Vc7/bin like this:
c:/(...)/Vc7/bin> editbin.exe /LARGEADDRESSAWARE /Path/To/The/Program.exe
Afterwards this bit can be checked with the dumpbin.exe utility:
c:/(...)/Vc7/bin> dumpbin.exe /headers /Path/To/The/Program.exe
Among other things a line like this one should appear:Application can handle large (>2GB) addresses
-
Note 1: The /3GB flag only works on MS Windows XP. Although MS Windows 2000 also accepts this flag, it only lets the application use 2GB.
Note 2: If a 32bit application with the bit IMAGE_FILE_LARGE_ADDRESS_AWARE set is run on MS Windows XP 64bits edition , it can address 4GB of memory instead of 3GB.
Note 3: Avoid signed comparisons with pointers, pointers casting to integers (instead of unsigned integers) and hard-wired addresses.