Windows 32bit Memory Overview Part 2

Since a 32 bit OS can only access 4GB of memory, some magic needs to happen to allow the system to see additional memory.  Say hello to Physical Address Extension (PAE).  PAE allows the operating system itself to address more that 4GB of RAM. Each Process is still bound by the 4GB limits, but the VMM can utilize the all the Physical memory up to 64GB. How does PAE do it?  Starting with the Pentium Pro processor the x86 platform actually allows 36bits of address space, so  236 bytes  = 64GB addressable. PAE is automatically enabled on computers running Windows Server 2003 with Service Pack 1 (SP1) and Windows XP with Service Pack 2 (SP2) when DEP is enabled on a computer with a processor that supports the no-execute page protection feature.

The 2GB dividing line between user memory and kernel memory is completely arbitrary. 4GB memory tuning (4GT) is enabled by putting a /3GB switch in the boot.ini. Using the /3GB switch allocates 1 GB to the kernel and 3 GB to the User-mode space. But be warned, we are stealing from Peter to pay Paul here, and since Nonpaged Pool, Paged Pool & PTEs all reside in Kernel memory,  If the memory reduction in the pools is too great in a specific server installation, the server or the applications may generate an error or appear to stop responding.

You shouldn’t use 4GB Tuning in the following scenarios. The system has more than 16GB of memory, the server is a Terminal server, large file servers and Exchange are good examples when the /3GB alone does more harm than good

Exchange?? What do you mean Exchange? All the docs say to use the /3GB switch. What gives? Please welcome /userva to the party. The /userva=xxxx switch is designed to allow for more precise tuning of User-mode address space for applications that require more than 2 GB of User-mode space but do not require all the space that is provided by the /3GB tuning switch alone. Use the /userva switch with the /3GB switch in the Boot.ini file to tune the User-mode space to a value between 2 and 3 gigabytes (GB), with the difference (3,072 less xxxx) being returned to Kernel mode.

OK, so now the OS can see more than 4GB of Memory, but my application is still limited to 2-3GB of memory.  How can my applications use more memory?

As stated earlier by using PAE we give the OS the ability to address memory over the 4GB mark. Windows 2003 Enterprise and Datacenter Editions make use of the x86 36bit memories addressing for applications with an API called Address Windowing Extensions (AWE). The AWE API allows an application to transfer memory pages above the 4GB limit into the addressable memory area where it can make changes to the pages. This permits applications such as SQL Server that use large datasets to manage them in RAM rather than a slow paging file. AWE locks physical memory address space to an application. No other application can use this memory and it can’t be pages to disk.

What’s new in Vista and Server 2008 32bit?

Let say we have a Windows 2003 Server running Terminal Server  with the following Kernel memory utilization:

      Paged pool: 50%

      Non-paged pool: 70%

      System PTEs: 98%

Even though there is still fair amount of memory in the paged & nonpaged pools, essentially this system is loaded to its maximum capacity because the System PTEs are fully exhausted. 32bit versions of Windows have relatively low maximum values for these memory areas, that all need to be allocated out of the 1-2GB of kernel virtual memory space. Up until Vista this allocation was only done at boot up.

 In Windows Vista/2008, kernel virtual address space is dynamically allocated. The sizes and locations of the paged pool, nonpaged pool, System Cache & PTEs are no longer fixed, but are dynamically adjusted according to the current operational requirements. This simple but effective change resolves the single pool exhaustion issue described above.  Now, not only can Peter steal from Paul, but Paul can steal back from Peter.

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

Comments