64-bit Windows, 32-bit B/Max - Memory limit = ??

BlitzMax Forums/BlitzMax Programming/64-bit Windows, 32-bit B/Max - Memory limit = ??

SystemError51(Posted 2012) [#1]
I have been using the search function and read through quite a few threads discussing 64-bit. The tl;dr-version of most threads is that a native 64-bit Blitz[any] won't be coming any time soon.

However at some point in the future I may have to address huge amounts of memory (possibly more than 4 GB).

Now I know, that after 2GB the world ends as far as 32-bit apps are concerned.

However, I found this nice little interesting page of Microsoft, and it seems that on Windows Server 2008 R2 (on which my game's server is running on), the memory limit is quite different:

Physical Memory Limits: Windows Server 2008 R2

The following table specifies the limits on physical memory for Windows Server 2008 R2.
Windows Server 2008 R2 is available only in 64-bit editions.

Version					Limit on X64
[...]
Windows Server 2008 R2 Enterprise	2 TB


Source:
Physical memory limits in Windows 7

Basically the question is:

Can 32-bit apps on Server R2 in theory use more than 2 GB?


Cheers for all your help
-- Marcus

Last edited 2012


xlsior(Posted 2012) [#2]
Can 32-bit apps on Server R2 in theory use more than 2 GB?


Kinda, sorta, slightly. It can be tweaked to allow for 3GB, but that still won't do you any good unless the application was written with >2GB in mind. Since blitzmax in all likelyhood wasn't, in practice that means that it won't change anything.

http://blog.circlestorm.org/index.php?/archives/4-3GB-ram-for-32bit-apps-on-64bit-windows-os.html

One potential workaround: IIRC the 2GB is -per 32-bit process-. You may be able to extend it a little by splitting your program into 2 independent programs, exchanging information while running simultaneously, that can access more than the 2GB combined.

(From a practical point of view: 32-bits applications can *address* a max of 2^32=4GB memory... So unless the OS transparantly translates things to higher memory ranges, there may be a 4GB hard limit regardless?)