Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If my operating system is 64 bit, can my 32 bit applications use 64 bit memory (> 3.5GB)?

share|improve this question

migrated from serverfault.com Apr 2 '11 at 4:14

This question came from our site for professional system and network administrators.

add comment

4 Answers

up vote 6 down vote accepted

If the app is AWE aware then they can use an address space beyond 4Gb, though less efficiently than a 64-bit app would. It is even possible for 32-bit processes under 32-bit Windows variants to access more than the 32-bit address space would allow, if PAE is anabled and the process is capable of using it.

An individual 32-bit process (that is not AWE aware) is usually limited to 3Gb (the first Gb of its virtual address space being reserved for kernel related action) but if you are running multiple processes then they will be able to use more in total (each can use up to 3Gb, total memory permitting) as their virtual address spaces are not shared.

The limit being per-process is more helpful in a Unix-like environment where services tend to be process based rather than thread based (multiple threads in one process share the processes resources and therefore share a single 3Gb virtual address space) as is more common under Windows (starting a new process in Windows as quite expensive so threads are preferred, under most Unix environments starting a new process isn't much more resource consuming than starting a new thread). It isn't very helpful for a machine that is running just SQL Server, for instance, as that it only going to be one process so will hit the 3Gb limit (some editions can be configured to be AWE aware but not all, and the feature is slated to be removed in the next major release).

As well as the 32-bit processes being able to use more than 3Gb in total the OS will be able to use any unused memory for disk caching, so it may not go to waste, assuming the processes do not open files in such a way as to tell the OS not to bother doing this.

share|improve this answer
    
32-bit process with IMAGE_FILE_LARGE_ADDRESS_AWARE set has a limit of 4 GB, not 3. msdn.microsoft.com/en-us/library/aa366778(VS.85).aspx –  Mark Sowul Apr 2 '11 at 4:34
add comment

If the application uses AWE, then yes (although this is not restricted to 64-bit OSes). Without it, the process is still restricted to a 4GB address space.

share|improve this answer
    
-1, Whilst true, I think the partial answer is misleading as no (non AWE) 32bit process will ever have 4GB RAM available to it. –  pipTheGeek Apr 1 '11 at 22:03
    
@pipTheGeek Erroneous: 32-bit process with IMAGE_FILE_LARGE_ADDRESS_AWARE set = 4GB available. msdn.microsoft.com/en-us/library/aa366778(VS.85).aspx –  Mark Sowul Apr 2 '11 at 4:33
    
@Mark - I had forgotton that, and I've corrected my answer below. I still think this answer is incomplete though. –  pipTheGeek Apr 2 '11 at 13:30
add comment

Sorta, depending on what you mean.

Assuming Windows...

If the OS is 64-bit, a 32-bit process by default gets 2 GB of user-address virtual address space. If the PE header of the .exe file is marked with the IMAGE_FILE_LARGE_ADDRESS_AWARE flag, then the process will get 4 GB of user-addressable virtual address space. In either case, the kernel's virtual address space is the same as 64-bit processes, since it is shared across all processes. Also of note, 64-bit processes that do not set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag also only have access to 2 GB of user virtual address space.

The things you hear about special boot flags, 3 GB, /3GB switches, or /userva are all about 32-bit operating systems and do not apply on 64-bit Windows.

This is all gone over in excruciating detail on Microsoft's Memory Limits for Windows Releases page.

@David Spillett's answer also touches on another point: Multiple processes, all limited to 2 GB of user space, can still use significant amounts of RAM if available, as can the file cache.

share|improve this answer
add comment

A 32 bit process on a 32 bit OS has a 4GB address space, 2GB of which is reserved by the OS, 2GB available for the process.
There is a switch that can be specified to the OS (/3GB) that changes the amount reserved for the OS to only 1GB and allows the process to have 3GB, BUT, only if the process declares it self as large address aware in the flags of the executable.

On a 64 bit OS a 32 bit process will get 4GB if it is large address aware, 2GB otherwise.

All of this is for non AWE aware processes. If the process is capable of using AWE then, as others have said, it can use a large address space, but less efficiently then a 64 bit process.

PAE allows a 32 bit OS to use more than 4GB of RAM, however, it has compatability issues and was disabled in XP by one of the service packs so it is only available on server OS versions.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.