neems said:
It's not 32 bit processors that have a limit on memory, it's 32 bit operating systems. XP 32 and Vista 32 both have a 3.3 gig 'ceiling' for RAM, I gather it has something to do with memory addressing or some such esoteric concern.
A 64 bit OS will happily use 4 gig of RAM, and beyond.
The annoying thing is that MicroSoft know how to make a 32 bit OS utilise more than 3 gig of RAM, they have a work around that they used in various server based versions of Windows, they just didn't bother for XP and Vista.
Both your operating system and your CPU impose limits on your capabilities.
A 32-bit processor actually does limit you to 4 gigs of byte-addressable memory.
It's fairly straightforward:
Size of memory register = 32 bits.
Number of things you can count using 32 binary digits = 2^32.
Size of each thing you're counting = 1 byte (hence "byte-addressable").
(Number of things you can count using 32 binary digits) * (size of each thing you're counting) = 2^32 bytes = 4 GB.
What some versions of Win2k3 Server let you do is address memory in units larger than bytes, using a special feature of the hardware called PAE [http://en.wikipedia.org/wiki/Physical_Address_Extension]. Info here [http://www.microsoft.com/whdc/system/platform/server/PAE/PAEmem.mspx].
Since you're trying to play a game rather than run 1000 instances of a web service, though, you wouldn't actually benefit from this trick. That's because you're still limited (once again by that 32-bit memory register) to only 4 GB of virtual memory
per process.
Hell, even that 4 GB of RAM can't all be used by your game because Windows, like Linux, splits each process' address space into "system-level" and "user-level" space, in order to give the application access to the system (by default, you get 2 GB of user-level virtual address space per process; you can set a flag somewhere to make it 3 GB instead).
In conclusion: unless it's running on a 64-bit system and specifically compiled for it, your Windows game is never going to be able to load more than 3 GB of its own resources into RAM anyway. (Your OS is still quite capable of using the full 4 GB of physical RAM for stuff, though -- just not all part of one process.)
-- Alex
EDIT: Woops! Good catch by Garak here:
Elim Garak said:
http://www.codinghorror.com/blog/archives/000811.html
Some of the stuff your procesor is addressing with it's 4 byte-addressable GB isn't RAM.