More than 2 GB Address Space

Wed, 2007-07-18 10:56 by admin · Forum/category:

More than 2 GB Address Space

The following text is courtesy of Bruce Sanderson, MVP.

Any process running under Windows gets a Virtual Address Space of 4 GB, no matter how much RAM is actually installed on the computer. Actually, this is essentially the same for all operating systems running on 32 bit hardware that implement virtual memory.

The only way to increase the size of the virtual address space beyond 4 GB is by using 64 bit hardware with an operating system and application built for that hardware.

In the normal, default Windows OS configuration, 2 GB of this address space are allocated to the process's private use and the other 2 GB are allocated to shared and operating system use.

The nub of it is, that no matter how much physical RAM is in the computer,
the amount of memory available in the application's private part of the
virtual address space in 32 bit Windows implementations is limited to:

1. 2 GB - without the /3GB switch - this is the normal, default maximum
private virtual address space
  or
2. 3GB with the /3GB switch AND a special application modification (more details below)
  or
3. any physical RAM not used by the OS and other applications by modifying
the application to use the AWE (Address Windowing Extensions) API - see:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base/address_windowing_extensions.asp

See:

The last reference above gives the physical memory (RAM) limitations of various Windows versions as:

Windows NT 4.0, Windows 2000 Professional and Server 4 GB
Windows 2000 Advanced Server 8 GB
Windows 2000 Datacenter Server 32 GB
Windows XP Professional and Windows Server 2003 4 GB
Windows Server 2003 Enterprise Edition 32 GB
Windows Server 2003 Datacenter Edition 64 GB

To use physical memory (RAM) above 4 GB, the /PAE switch is required in the boot.ini. Also, the processor(s) (Intel Pentium Pro or later) and the other hardware (motherboard and chipset) have to support the Intel PAE feature.

PAE = Physical Address Extension - extends the physical memory address to 36
bits

Note that if the /3GB switch is used, the maximum RAM addressable by any
Windows version is 16 GB (http://support.microsoft.com/kb/283037/).

The /3GB switch is available on these operating systems:

Windows XP Professional
Windows Server 2003
Windows Server 2003, Enterprise Edition
Windows Server 2003, Datacenter Edition
Windows 2000 Advanced Server
Windows 2000 Datacenter Server
Windows NT Server 4.0, Enterprise Edition

Also quoted from this article:

"No APIs are required to support application memory tuning. However, it would be ineffective to automatically provide every application with a 3 GB address space. Executables that can use the 3 GB address space are required to have the bit IMAGE_FILE_LARGE_ADDRESS_AWARE set in their image header. If you are the developer of the executable, you can specify a linker flag:

/LARGEADDRESSAWARE

"To set this bit, you must use Microsoft Visual Studio Version 6.0 or later and the Editbin.exe utility, which has the ability to modify the image header (/LARGEADDRESSAWARE) flag. For more information on setting this flag, see the Microsoft Visual Studio documentation."