views:

2704

answers:

7

This is a windows question. I know under normal circumstances a 32 bit process can only access 2GB of RAM (or 3GB with a special switch in the boot.ini file). When running a 32 bit process on a 64 bit operating system, how much memory is available? Are there any special switches or settings that can change this?

How about a Common Language Runtime Application built in x86 configuration? How does this get 4GB?

+1  A: 

It will be the same 2/3 gig limit. There won't be more than that per process.

Daniel A. White
+5  A: 

4 GB minus what is in use by the system if you link with /LARGEADDRESSAWARE.

Of course, you should be even more careful with pointer arithmetic if you set that flag.

MSN
A: 

You've got the same basic restriction when running a 32bit process under Win64. Your app runs in a 32 but subsystem which does its best to look like Win32, and this will include the memory restrictions for your process (lower 2GB for you, upper 2GB for the OS)

Sean
A: 

With a 32bit process, you can use only the 32bit adress room. So it's the same 3gig limit. A 32bit process doesn't care of a 64bit CPU.

If you try to use more than 4gig-(Memory in use by System), the machine is going to swap and slow down your system.

Applications can use a virtual adress enlargement for more ram than 3gb. But they must be complied with the right flags. Not every system can handle this.

Martin K.
+3  A: 

A 32-bit process is still limited to the same constraints in a 64-bit OS. The issue is that memory pointers are only 32-bits wide, so the program can't assign/resolve any memory address larger than 32 bits.

Ben S
+7  A: 

2 GB by default. If the application is large address space aware (linked with /LARGEADDRESSAWARE), it gets 4 GB (not 3 GB, see http://msdn.microsoft.com/en-us/library/aa366778.aspx)

They're still limited to 2 GB since many application depends on the top bit of pointers to be zero.

Michael