4 GB limit

from Wikipedia, the free encyclopedia

The 4 GB limit (also 4 GiB limit ) denotes the maximum size of an address space (for example the main memory ) that can be used with 32-bit addresses with byte-wise addressing, for example by a process under a 32-bit - operating system . Some 32-bit architectures can provide a larger address space using segmentation techniques.

Problem Description

The problem occurs in particular with computer architectures that use 32-bit addresses (unsigned integers ) to address data in the main memory . Due to this restriction, it is not possible for the processors concerned to address more than 2 32 bytes , i.e. 4 GiB. This restriction applies to both the logical ( virtual ) address space that the program addresses and the physical address space - the main memory actually installed in the system. Even if the actual installed memory of a computer is less than 4 GiB, the 4 GiB limit can affect some programs, for example applications that use large memory-mapped files.

3 GB barrier

Sometimes the problem exacerbates to a 3 GB barrier or a 2 GB barrier .

Real address space

The usable area of ​​the real address space can be further restricted by further influences from hardware ( motherboard , I / O devices - especially the size of the video RAM ) and / or the operating system. Common computer architectures branch off real address space for the insertion of system ROM and IO areas, e.g. B. Onboard and expansion hardware such as graphics and sound cards ( Shared Memory / Unified Memory Architecture ). In the x86 environment, 2.0 to 3.75 GiB RAM can usually be used; the exact values ​​depend on the mainboard and the expansion of internal expansion cards as well as the BIOS settings. The usable area is also sometimes not completely available, but is fragmented between 2.0 and 4.0 GiB .

Virtual address space

In addition, under common 32-bit operating systems, a single 32-bit process cannot occupy more than 2 GiB ( Windows ) or 3 GiB ( Linux ) of virtual address space , since the upper part of the 4 GiB address space is permanently assigned to the operating system and cannot be allocated by application programs.

Under 32-bit Windows operating systems, the fixed allocation of 2 GiB to the operating system can be reduced to 1 GiB ( /3GB switch). To use this, the IMAGE_FILE_LARGE_ADDRESS_AWAREflag must also be activated in the application's header ; then with a 32-bit application up to 3 GiB on a 32-bit Windows or 4 GiB of virtual address space on a 64-bit Windows are possible.

Troubleshooting

The 4 GiB limit does not exist if a 64-bit system (operating system and application) is used. Here the theoretical limit of the address space is 2 64 bytes, i.e. 16 Exbibytes . Many processors, like those of the AMD64 architecture, have more than 32 but fewer than 64 address lines and can therefore address less than 16 Exbibytes of RAM. The physical address space is also much smaller here. One problem with the broadening of the addresses is that 64-bit operating systems can only use 64-bit kernel drivers because in this case the operating system kernel is implemented as 64-bit and kernel drivers are executed directly in the address space of the operating system kernel, the one Mixing of 32- and 64-bit software in itself does not allow. Apart from kernel drivers, current operating systems also have user mode drivers, which are in principle normal application software and, depending on the operating system, also work as a 32-bit version. Such drivers cannot currently be used for devices such as graphics cards etc. 64-bit kernel drivers were rare after these operating systems were introduced, and still are today for old, special, and rare hardware. In practice, this problem mainly affects proprietary software because manufacturers do not maintain drivers longer than absolutely necessary, especially in the case of inexpensive devices such as printers, scanners, etc. and are usually not interested in letting others take care of older drivers. In principle, however, free software must also be adapted to 64-bit in order to function correctly; a simple recompilation of the software can, but does not have to be done. Whether or not software is suitable for 64-bit depends entirely on the software and not directly on its development model. Free software only has the theoretical advantage that it can be adapted more easily. Modern 64-bit operating systems usually continue to run applications that were only compiled for 32-bit, Windows systems e.g. B. by WOW64 . However, depending on the application, you only have a maximum of 2 to 4 GiB memory available.

On 32-bit systems there are various options for overcoming the 4 GiB limit with PSE-36 and PAE . These processor expansions only increase the addressable physical memory, each process can still only address 4 GiB data at the same time. Under Windows there is also the option of showing physical memory pages beyond the 4 GiB limit in the logical address space of the process via an interface called AWE , with which a 32-bit process can address a total of more than 4 GiB. However, only some specific versions of Windows 2000 and Windows Server 2003 allow the use of RAM beyond the 4 GiB limit on a 32-bit system; the consumer operating systems Windows XP (from SP2), Windows Vista and Windows 7 deliberately do not allow this in their 32-bit versions, in order to avoid incompatibilities with various drivers from external companies. For normal Windows users, the only solution is to switch to a 64-bit version of the operating system.

Web links

Individual evidence

  1. Virtual Memory in Linux Aaron Hall (December 2002, English)
  2. The oft-misunderstood / 3GB switch Raymond Chen (2004, English)
  3. http://msdn.microsoft.com/en-us/library/aa366778(VS.85).aspx