Reputation: 2033
I think that the question sounds clear, but for further explanation:
Suppose we have Windows 7 x64 PC with 8GB of RAM installed on it; (64bit OS with 32bit process is my intention)
Question 1: how much memory can a 64bit process use in this environment?
Question 2: how much memory can a 32bit process use in this environment?
Question 3: If a 32bit process can only use 2GB of RAM in this environment,(even if it is LARGE ADDRESS SPACE AWARE: 3gb), however most games are 32bit;, so does this mean that: Although we have 8gb of RAM installed, that a game for example can only use 2-3gb of RAM at any given time?
Upvotes: 1
Views: 2894
Reputation: 941317
On a demand-paged protected mode operating system like Windows, the amount of RAM that's available is entirely unrelated to the amount of virtual memory a process can use. The limiting factor is how much virtual memory can be backed by the paging file. The paging file in Windows starts out with a size that's determined at boot time and registry settings. From there, Windows can grow the size of the paging file if necessary when processes demand more memory.
how much memory a 64bit process can use this environment?
That's unpredictable but at least as much as the current available space in the paging file. You'd typically get around 13 gigabytes. This space can grow by leaps and bounds, on the second run of the program it is likely to be able to consume more memory as Windows would have caught up and increased the paging file. You can see this in action in this blog post by Mark Russinovich.
how much memory a 32bit process can use in this environment?
By default it is 2 gigabytes. The large-address-aware option bit in the program's EXE header can extend it to 4 gigabytes. Most 32-bit programs will have this option bit turned off.
If a 32bit process can only use 2GB of ram in this environment ...
It is either 2 or 4 gigabytes, not 3. And re-emphasizing, it has nothing to do with RAM. Even on a machine with 8 gig of RAM, a 32-bit process that's LAA is very unlikely to ever consume 4 gig of RAM. RAM is a shared resource, all processes need some of it. A 32-bit process that consumes 4 gig is quite likely to have some of it paged out.
Upvotes: 1
Reputation: 69632
Win32 app, x64 OS:
Upvotes: 0
Reputation: 57650
Question 1: how much memory a 64bit process can use in this environment?
It can use all of your memory.
Question 2: how much memory a 32bit process can use in this environment?
For x86 executable on x64 machine it consumes by default 2GB. If IMAGE_FILE_LARGE_ADDRESS_AWARE is set it can use 4GB.MSDN.
Interesting thing is an x64 executable can use at most 2GB on a x64 machine if IMAGE_FILE_LARGE_ADDRESS_AWARE is not set or cleared.
Question 3: (I'm not sure) If a 32bit process can only use 2GB of ram in this environment,(even if it is LARGE ADDRESS SPACE AWARE: 3gb), and on the other hand (as far as I know) most of the games are 32bit;, so does this mean that: Although we have 8gb of RAM installed, that (for example game) can only use 2-3gb of RAM at any given time????
No its 4GB
Upvotes: 1