http://msdn2.microsoft.com/en-us/library/bb613473.aspx
Thats the thing I need to understand. I tried to follow it, but I can't quite get it. So, can someone explain this in an easier way? I have XP Pro.
Thank you
2007-09-23
09:34:33
·
4 answers
·
asked by
Mashu
4
in
Computers & Internet
➔ Programming & Design
4-Gigabyte Tuning
On 32-bit editions of Windows, applications have 4 gigabyte (GB) of virtual address space available. The virtual address space is divided so that 2 GB is available to the application and the other 2 GB is available only to the system.
The 4-gigabyte tuning (4GT) feature, formerly called 4GT RAM Tuning, increases the virtual address space that is available to the application up to 3 GB, and reduces the amount available to the system to between 1 and 2 GB.
For applications that are memory-intensive, such as database management systems (DBMS), the use of a larger virtual address space can provide considerable performance and scalability benefits. However, the file cache, paged pool, and non-paged pool are smaller, which can adversely affect applications with heavy networking or I/O. Therefore, you might want to test your application under load, and examine the performance counters to determine whether your application benefits from the larger address space.
2007-09-23
09:44:29 ·
update #1
To enable an application to use the larger address space, set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag in the image header. The linker included with Microsoft Visual C++ supports the /LARGEADDRESSAWARE switch to set this flag. Setting this flag and then running the application on a system that does not have 4GT support should not affect the application.
On 64-bit editions of Windows, 32-bit applications marked with the IMAGE_FILE_LARGE_ADDRESS_AWARE flag have 4 GB of address space available.
Itanium editions of Windows Server 2003: Prior to SP1, 32-bit processes have only 2 GB of address space available.
Itanium editions of Windows 2000: 32-bit processes have only 2 GB of address space available.
Use the following guidelines to support 4GT in applications:
* Addresses near the 2-GB boundary are typically used by various system DLLs. Therefore, a 32-bit process cannot allocate more than 2 GB of contiguous memory, even if the entire 4-GB address space is available.
2007-09-23
09:44:44 ·
update #2
* To retrieve the amount of total user virtual space, use the GlobalMemoryStatusEx function. To retrieve the highest possible user address, use the GetSystemInfo function. Always detect the real value at runtime, and avoid using hard-wired constant definitions such as: #define HIGHEST_USER_ADDRESS 0xC0000000.
* Avoid signed comparisons with pointers, because they might cause applications to crash on a 4GT-enabled system. A condition such as the following is false for a pointer that is above 2 GB: if (pointer > 40000000).
* Code that uses the highest bit of a pointer for an application-defined purpose will fail when 4GT is enabled. For example, a 32-bit word might be considered a user-mode address if it is below 0x80000000, and an error code if above. This is not true with 4GT.
VirtualAlloc usually returns low addresses before high addresses. Therefore, your process may not use very high addresses unless it allocates a lot of memory or has a fragmented virtual address space
2007-09-23
09:45:06 ·
update #3
To force allocations to allocate from higher addresses before lower addresses for testing purposes, specify MEM_TOP_DOWN when calling VirtualAlloc or set the following registry value to 0x100000:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\
Session Manager\Memory Management\AllocationPreference
2007-09-23
09:45:19 ·
update #4
Well, I want to make it so the OS recognizes 4gb of ram. It only sees 3.3 right now, but I want to change it to 4. So...this is what the document said...but I don't quite understand where to start, or what to do.
2007-09-23
09:48:04 ·
update #5