Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I have a system with more than 4GB of RAM, and PAE enabled (on a 64-bit CPU), will a threaded 32-bit application be able to use 4GB total, or 4GB per thread?

I ask because I am running DAW (digital audio workstation) software which is only compatible with Windows XP 32-bit (can't use 7 or XP x64 because of bad drivers), and my DAW software (Sonar X1 Producer) is a threaded app. I plan to upgrade from 4GB to 12GB soon, and I would like to able to use all of it (I can use all of it on my Win7 x64 install). Since I will only be running the one application, it is mostly only useful (for the XP install) if each thread can use 4GB, as opposed to the application using 4GB.

share|improve this question
up vote 2 down vote accepted

The process will be able to use every single byte of physical RAM. There is no limit to how much physical RAM a process can use, so long as the operating system can access that physical RAM.

However, the shared address space of all the threads in the process will be fundamentally limited to less than 4GB (and in practice, to 2GB or 3GB) since that is the maximum supported address space for a 32-bit process. 32-bit processes use 32-bit pointers, and 2^32=4GB. All the threads share all their address space, otherwise you couldn't pass a pointer from one thread to another.

This limitation applies regardless of PAE and regardless of how much physical memory you have. It is normally 2GB of address space for 32-bit processes. You can tweak it to 3GB with the /3GB switch.

Again, this has nothing to do with use of physical memory -- every process can always use every single byte of physical memory. It's strictly a limitation on address space. PAE allows the operating system to use more physical memory. The address space limitation affects how processes use virtual memory.

share|improve this answer
How interesting... Is there any reasoning behind why only 2 or 3 GB is addressable, even in a 4GB virtual address space (I think that's the right term...)? I will certainly enable the 3GB limit. – gjsmo Oct 31 '11 at 20:26
It's because 32-bit operating systems were designed at a time when 4GB was more than anyone could imagine using. So they were designed to place both the kernel's view and the user space view in the same address space to optimize kernel code and particularly to optimize moving information between user space and kernel space. A 2GB/2GB user/kernel split is the default. – David Schwartz Oct 31 '11 at 20:42
I'm pretty sure it actually has more to do with the page table than anything else. The 2/2 split is the default because few programs ever need more than 2GB of memory at a time. And technically an x86 OS can address more than 4GB of ram. It just requires a much larger page table. Notice the x86 version of Windows Server and Red Hat could use more than 4GB of RAM. – surfasb Nov 3 '11 at 4:31
@surfasb: Their kernels could access more than 4GB of physical RAM because of PAE. But that has nothing to do with the issue of how much address space a process can have. The 2/2 split and the limit on 32-bit processes is about address space, not physical RAM. (These two completely different issues are very frequently confused.) – David Schwartz Nov 3 '11 at 4:34

MSDN discusses Physical Address Extension and other large memory addressing extensions. Basically, any 32-bit application is only capable of mapping ~ 2GB of memory(it depends per machine). While the OS is capable of accessing much more, each individual application is still limited to the 2GB address space. Note: The 2GB limit is per 32bit process not per thread.

Windows XP Professional does support a 4GT (4-gigabyte tuning) mode that allows applications to address up to 3GB of address space. This can be enabled by using the /3GB switch in the boot.ini file.

share|improve this answer
Technically, the 2GB is the limit of mapped memory. but you can address up to 4GB. It also only applies to 32 bit processes.…. I added edits. – surfasb Oct 31 '11 at 3:19
Added: It just goes to show how confusing physical memory vs physical address space vs virtual address space vs virtual memory has become. – surfasb Oct 31 '11 at 3:52

By default, 32bit apps. can access 2Gb of address space, irrespective of the amount of physical RAM or what 'flags' (such as /3G /PAE) are set ..

Apps. with the LARGEADDRESSAWARE flag set in the .exe header can access up to total (sum of all threads) 3Gb of address space on a 32bit system, 4Gb on a 64bit system.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .