How 4GT Works
Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2
How 4GT Works
In this section
4GT Architecture
4GT Processes and Interactions
The technology called 4-gigabyte tuning (4GT) is a scale up component in the Windows Server 2003 family. The Microsoft operating environment delivers scalability via two methods: scale up and scale out. Scaling up refers to running a single application or image on a single server and having the ability to incrementally add system hardware resources (processors and memory) to increase overall system performance. Scaling out refers to distributing the computing workload among multiple servers with the ability to add or subtract servers to increase or decrease capacity.
Enterprises are required to scale flexibly to respond to spikes in business and to support the rapid roll out of new products and services. It is therefore increasingly important that an organization’s computing infrastructure provides the ability to increase or decrease computing capacity almost instantly, while continuing to deliver value. 4GT helps provide this scalability.
There are few restrictions regarding the environment in which 4GT can be enabled. 4GT has the following hardware and software requirements:
x86-based processor
2 gigabytes (GB) or more of RAM
Windows Server 2003, Enterprise Edition, or Windows Server 2003, Datacenter Edition
Windows Server 2003, Standard Edition, but only in non-production environments.
4GT should not be used if either of the following is true:
Greater than 16 GB of physical memory are available and Physical Address Extension (PAE) X86 is enabled on the server.
Important performance characteristics of the application are adversely affected by limiting the kernel to 1 GB of RAM, for example, more than 1 GB of RAM might be needed to support the maximum number of concurrent connections.
Note
- 4GT is not required on the 64-bit versions of the Windows Server 2003 family.
4GT Architecture
4GT alters the way the memory manager allocates the virtual address space available on the computer. The following diagram and corresponding table illustrate this process.
4GT Architecture
When virtual memory space is requested by the user mode applications or the kernel, the memory manager determines where that memory will physically reside. The virtual address to physical address translation information is kept in the page table, which is part of the kernel’s virtual address space. Using this translation data, the memory manager accesses the data
The following table describes the components related to the 4GT architecture.
Components of the 4GT Architecture
Component | Description |
---|---|
Kernel or User Application |
The user mode application or kernel process that requests data at a specific virtual address space. |
Memory Manager |
Operating system component that allocates, organizes, and tracks memory assignments. |
4 GB Virtual Address Space |
Virtual addresses representing the 4 GB of RAM that is recognized by default by the operating system. Using 4GT, this 4 GB is divided to give user mode applications 3 GB of virtual address space and the kernel 1 GB of virtual address space. The kernel’s 1 GB is further allocated into many other specific sections, including the page table area. |
Page Table |
A portion of the kernel’s virtual address space that indexes virtual memory addresses to physical addresses. |
Paging File |
The files on a hard disk where data is stored instead of storing that data in RAM. |
RAM |
The physical RAM where data is stored. |
4GT Processes and Interactions
4GT is not enabled by default. In order to enable 4GT, the /3GB switch must be added to the server’s Boot.ini file. The addition of this option causes the operating system to change the default virtual address allocations for applications and the kernel. Upon starting an application, the operating system examines the header file for that application. If the application header includes the “IMAGE_FILE_LARGE_ADDRESS_AWARE” flag and the /3GB switch has been used to enable 4GT, then the application has access to the greater virtual address space.
Instead of dividing the available 4 GB of virtual memory evenly between the kernel and any specific user mode application, 4GT provides less virtual address space to the kernel. This results in 3 GB of virtual memory to be allocated to the application. With 4GT, the virtual addresses available to the application range from 0x00000000 through 0XBFFFFFF. This is an increase of the default range of 0x00000000 through 0x7FFFFFFF. The virtual memory address range for the kernel shrinks from 0x80000000 through 0xFFFFFFFF to 0xC0000000 through 0xFFFFFFFF, as shown in the following diagram.
Virtual Memory Allocation
4GT can be used with Windows Server 2003, Enterprise Edition, or Windows Server 2003, Datacenter Edition. In addition, 4GT can be used with Windows Server 2003, Standard Edition, but only in non-production environments.
The /Userva Parameter
In some cases, restricting the kernel to only 1 GB of memory might not be desirable, but the kernel might not need 2 GB either. In order to further refine memory management options, a new parameter, /Userva, has been introduced in Windows Server 2003, Standard Edition; Windows Server 2003, Enterprise Edition; and Windows Server 2003, Datacenter Edition. This parameter can only be used in conjunction with the /3GB switch. The /Userva parameter allows an administrator to determine the specific size of the user mode virtual address space between 2 GB and 3 GB. The value specified by the /Userva parameter in the Boot.ini files (expressed in MB) determines the amount of memory the memory manager will return to the kernel. The amount of memory returned is 3072 MB less the value specified by the /Userva parameter. For example, to increase the kernel’s memory space by 172 MB, the following parameter combination would be used in the Boot.ini file:
3GB /Userva=2900
This additional kernel address space is held in reserve and used as additional address space for Page Table Entries (PTEs) in the event that the system runs out of free PTE space. This address space is not allocated to PTEs until the system runs low on PTE space. For more information about PTEs, see “Page Table Entries” later in this section.
Page File
Page files store data that cannot be kept in RAM. The default page file size is equal to 1.5 times the amount of physical memory on the system. On a 4 GB computer, this can result in a page file larger than 4 GB. Under such circumstances, the effectiveness of this large of page file could be minimal, based on the usage of the system, such as when hosting database management applications. However, there are also times when even larger page files are needed, such as when multiple applications are consolidated on to one system. Therefore, on servers with 4 GB or more of memory, it is often preferable to change the default size of the page file based on the usage of the server. Regardless, on x86-based computers with 4 GB or more of physical memory there should be a page file sufficiently large to capture a kernel memory dump.
A page file size of at least 2,050 MB is the minimum size necessary for computers with 4 GB or more of physical memory to capture a complete kernel memory dump. The page file can be much larger (up to three times the physical RAM is typical) if the system is being used for application consolidation.
Page Table Entries
The page table is used by the memory manager to track the physical location of the page files. When using 4GT, because of the smaller amount of virtual memory allocated to the kernel, the number of Page Table Entries (PTEs) that can be recorded by the memory manager in the page table is also significantly reduced. In a standard configuration (without 4GT), there are typically 80,000 to 140,000 PTEs available. This is reduced to only 40,000 PTEs when using 4GT. This can lead to problems when the amount of physical memory increases and the kernel is required to keep track of larger and larger amounts of PTEs.
4GT and PAE X86
PAE X86 is another technology that allows access to additional physical memory. 4GT and PAE X86 can be combined to provide applications large amounts of virtual memory and provide a significant performance boost. However, using 4GT reduces the amount of PTE space available to the kernel, while using PAE X86 dramatically increases the amount of memory that must be indexed and translated by the memory manager. Thus this combination will exhaust system kernel space much earlier than normal. Because of this, the memory manager imposes a virtual memory limit of 16 GB on a system with both 4GT and PAE X86 enabled. Even if a system has 32 GB or more of physical memory, if both options are enabled, only 16 GB of memory will be recognized.
Note
- Even though the memory manager imposes a hard limit of 16 GB when both 4GT and PAE X86 are enabled, it is possible to encounter problems with lesser amount of memory, such as 8 GB or 12 GB. Therefore, the kernel should be given as much memory as possible.